Difference between revisions of "DocumentLayers"
Revision as of 19:14, 11 July 2004
We've got the most important part of layers implemented now; a group can be turned into a layer by setting its inkscape:groupmode attribute to "layer" (it defaults to "group").
For now, all this does is permit the objects in a group to be directly selected, rather than selecting the group itself (i.e. by clicking or rubber-banding). To fulfill all the expectations for layers, there are still some things we need to take into account:
- There needs to be a notion of a "current layer", where e.g. the drawing tools and paste operate.
- At present, this "current layer" is always the root SVG element.
- The current layer should probably be determined by the most recent object selected -- the object's first layer ancestor (or the object itself, if it is a layer) becomes the current layer until another object is selected. Deselection should probably not alter the current layer.
- We need to handle the case where the current layer is removed from the document (either directly, or because one of its ancestors was removed) or stops being a layer (due to an inkscape:groupmode change).
- To find a new layer to become the current, we need to walk up the (pre-removal) hierarchy to find a layer, as if the parent of the removed/unlayered object had been selected.
- We need a layer dialog -- an ObjectTree window (operating on SVG objects) similar to the XMLEditor (which operates on XML nodes) should fulfill this requirement.
- What behavior should result from selecting a layer in the ObjectTree or XMLEditor? Should that actually select all of the layer's children, or should the layer (temporarily) behave like a group in terms of dragging/rotation/whatever?
- I personally lean towards the latter, though I think the former is what many apps with layers do. I think it depends on how much we think layers should break with their fundamental group-nature. -- MenTaLguY
- The main venefit from layers is being able to toggle visibility and editability of a layer. That's what layer palettes in most apps focus on, and what we must provide. As for selecting all objects within a layer, that may be useful too, but is of secondary importance IMHO. --bb
- Similarly, if a group's descendents are directly selected, should that group temporarily behave like a layer? Yes, options and dragging/copying should feel the same as if they were layers. Also de ObjectTree should reflect each action inmediatly.
- The schema should be something like this:
MasterDocument Document Layers Page RightPage LeftPage Groups Objects
From another point of view we can reflect the schema like this: ObjectProperties LocalProperties (shape, color, etc) GroupProperties (Group/s the Object belongs to) LayerProperties PageProperties DocumentProperties
Styles, in both views are floating above everything as a PropertiesGroup that affects the Elements the user decide to assign to that Style. The mechanism could be as simple as CSS.
Adobe seems to export their layers as simple groups with id's
One of the nice things about illustrator is that it automaicly creates sublayers []