We have multiple discussions on IRC about dependent shapes system in Krita. I feel really uncomfortable discussing that basing on a mere SVG standard, without real-world applications to that. So I decided to start a list of requirements that we want to fulfill by implementing such dependencies.
Requirements
- Text on path feature
- The user should be able to edit the path using the standard shape-editing tool
- The user should be able to edit custom handles provided by the text shape itself:
- anchors
- text offset from start of path (startOffset)
- offset from the curve (dy on <text>)
- change text position: below/above the path (side)
- [TODO] what else
- Text in shape feature
- The user should be able to resize the parent shape. When resizing happens, the internal text shape undergoes a relayout
- The user should be able to transform the parent shape. In this case the internal text of the shape is not relayouted, but just scaled/transformed (like all the shape decorations, like stroke/pattern).
- The user should be able to edit custom handles provided by the text shape itself:
- anchors
- offset from the sides of the shape (shape-padding)
- [TODO] what else
- SVG2 specification supports "referenced objects" feature, which behaves effectively like "cloned" shapes.
- [TODO] Do we actually want to support this feature on-the-fly? Will painters have enough usefulness in it? Right now our policy is bake/detach all the lazy links on loading.
- "Enter group" feature
- The user should be able to edit the shapes inside a group without ungrouping them
- Select "Enter group" mode
- All shapes except of the ones belonging to a group are grayed-out
- The user can select and edit shapes inside the group
- Clicking on any (grayed-out) shape outside the group exits the "enter group" mode.
- The user should be able to edit the shapes inside a group without ungrouping them
Questions to answer
- Are there any other usecases of dependent shapes framework?
- Should we support SVG2's "referenced object" feature? Personally, I believe that we shouldn't (and, afair, DOM-model doesn't actually keep runtime links for such objects, it detaches all references on loading, as per specification; though my info might be outdated)