On 12/6/05, Mathieu Dimanche <mdimanche@...8...> wrote:
a new class SPhighlight * container for all highlight_groups currently drawn. * a show_all_groups() function - calling all highlight_groups to draw themselves (on the sketch layer or another one ?)
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.
- positionning optionnal hint texts to avoid overlap, out of
screen, and maybe color similarities with the background
You don't need to worry about color similarities - just use the inverse color for it and it will always differ from the background. Then you only need to avoid color boundaries interfering with the text.
- choosing the right colors for the visual feedback of the group
depending on where (layer color) and what it is
Or you can make the highlight item consisting of different parts, one part inverse and the other fixed color (perhaps depending on layer). That's how the nodes (using SPCtrl canvas item type) are displayed in node tool: the inner part of the square is fixed gray/red/blue and the outline is inverse.
* a hide_all_groups() function, deleting all highlight_groups
Hiding is not the same as deleting, with regard to SPCanvasItems.
* SPhighlight_item_dot - one point - drawing style ("cross", "colored dot", etc...)
We already have SPCtrl for that, with different shapes and sizes - reuse it.
* 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).
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.
-- bulia byak Inkscape. Draw Freely. http://www.inkscape.org