sozi-projects/Sozi

Special layer used to automatically create frames

Opened this issue · 2 comments

Patch proposal

I think it would be helpful being able to set the frame position directly in inkscape. For this, one could create a special layer "SoziFrames" and put there objects (mainly rect) that are then used to generate frames on import.

Example:

  • create layer "SoziFrames"
  • put there rect to decide where your frames will be
  • load the SVG with Sozi
  • if and only if the "SoziFrames" is available:
    • add all layers
    • take all the objects in "SoziFrames"
    • sort them by id or another special attribute
    • for each object:
      • add a frame
      • select the new frame
      • set the outline element
      • rotate as much as the object's rotation

That's it. I can find time to produce a patch if you find this interesting. Also, if you have advice on the feature itself or on the implementation, I would be happy to know them!

Finally, as in issue #592, this feature can maybe overlap or merge with inkscape multipage feature.

Yes. I think this feature could be useful.

My personal preference would be to support the following layout:

  • Global SoziFrames layer (controlling layers that don't have a SoziFrames sublayer).
  • Content layer 1
    • SoziFrames sublayer 1
  • Content layer 2
    • SoziFrames sublayer 2
  • etc.

For each rectangle, maybe we should use the "Label" field of the object properties (XML attribute inkscape:label) to infer the frame ordering instead of the ID.

Hello, I tried working on this but I'm not that strong with JavaScript and the codebase is pretty large. Do you have any advice on how we could implement it? Where should we insert edits and which function should we use? Thanks!