
On 4/1/07, Maximilian Albert <Anhalter42@...173...> wrote:
I propose the following: pressing H and V in the Node tool already flips the selected nodes; all you need to do is to check if any of the selected nodes is mouseovered and if so, use it as the center.
Thanks for this suggestion! IMHO it's indeed the best way to do it. Just one question: What is the best way to easily obtain the current active (= mouseovered) node (if there is any)?
Like I said, it's already used in the code. So for node a, the check is:
if (a->knot && SP_KNOT_IS_MOUSEOVER(a->knot)) {
The variable active_node in nodepath.cpp seems to serve precisely this purpose. But it's declared global static, so it can't be accessed from other files. Is there a good reason for this? Why not make it a static member of, say, Inkscape::NodePath::Path? This was my first approach, and it works perfectly. But I want to make sure I'm not missing anything.
I didn't add this variable, so I was actually unaware of it :) If it works, that is, is properly updated by all relevant code, then indeed there's no reason not to use it and not to make it a public member of Inkscape::NodePath::Path.