On Mon, 5 Dec 2005, Mathieu Dimanche wrote:
Hi everyone
Since it's my first attempt at trying to make things improve in a software, using cvs, and trying to understand a whole project (and written in c++... sometimes), please don't be too harsh on me and on my english level, I'm just a little frenchy :)
Very used to illustrator, I miss some little things that make life easier, like moreeffective snapping.
So I tried to understand the whole object tree, reading both the doxygen and the code (...when there were comments) and finally managed to have a patch made. The functionnality is a pretty little one, I just made guides highlight when moved objects snap against them. For now, this only works for dragged objects and rectangles being drawed.
Thanks very much for the patch :-)
I post this for anyone to check if I do right, naming functions, indenting, thinking the whole problem, so please, feel free to over-comment my "work", for me to know if I can go on with these kind of updates. This is the first patch of my life, I hope I've made it well. Could you test that ?
My instinct is that you might be better off doing this using additional canvas objects (like you have suggested in some of your comments). In other words, you highlight things by creating a new object to overlay the thing you are highlighting.
I think this would make things much more general; the highlight operation is adding a canvas object, and un-highlight is removing all the "highlight" objects (which you could keep in a list). Otherwise you have a special case for each thing you've highlighted: note which guide line you changed and then change it back, note which grid line(s) you changed and then change them back etc. etc. Also, I think in some cases (e.g. highlighting a snap to a path) you're probably going to want to add new objects (perhaps a little circle, or something) rather than just changing existing ones.
However I'm not an expert with the canvas so I'd be interested in anybody else's comments.
Cheers
Carl