bulia byak a écrit :
SPCanvas has no layers as such. Just add a new SPCanvasItem on it and move it in the z-order appropriately (perhaps to the very top).
BTW, the entire SVG drawing is a single SPCanvasItem called SPCanvasArena. Only the arena is exported to bitmap, for example. All other canvas items are just helpers for editing.
I just had read that in src/desktop.cpp :
/* SPDesktop provides a certain set of SPCanvasItems, serving as GUI/ / * layers of different control objects. The one containing the whole/ / * document is the drawing layer. In addition to it, there are grid,/ / * guide, sketch and control layers. The sketch layer is used for/ / * temporary drawing objects, before the real objects in document are/ / * created. /
so I thought this sketch layer (not used it seems, maybe deprecated ?) was the kind of things I could use to draw highlights...
- SPhighlight_item_dot
- one point
- drawing style ("cross", "colored dot", etc...)
We already have SPCtrl for that, with different shapes and sizes - reuse it.
I think the HighlightItemDot could call an SPCtrl to draw ? the object can then have other options/parameters, like the prefered position, the "don't show that if the hightlight layer is too crowdy"/priority, etc...
- SPhighlight_item_segment
- 2 points or a <point/vector> pair
- bool for finite or infinite line
We don't really have infinite lines - e.g. guidelines are drawn to whatever the span of the visible rectangle is (see sp_guideline_render).
I was wanting just to have 2 line behaviors depending on 2 points, the "draw just between the 2 points", what's called a line segment in french (but I don't know if english uses this word), and the "draw past the points too, as guid or guide do in sp_guideline_render.
Overall, your plans are quite ambitious :) I'll be happy to see them implemented. Carl is the highest authority on the snapper classes that he wrote, but I may be of help with canvas-related code.
I will check the commit Carl said would to 10h ago to update my viewing of the whole implementation of this :)