Comment 4 for bug 1780775

Revision history for this message
Ian Bruce (ian-bruce) wrote :

It appears that the code responsible for control-handle locking when
converting a cusp node to smooth is in <src/ui/tool/node.cpp>, lines
286-292:

    case GDK_KEY_S:
        if (held_only_shift(event->key) && _parent->_type == NODE_CUSP) {
            // when Shift+S is pressed when hovering over a handle belonging to a cusp node,
            // hold this handle in place; otherwise process normally
            // this handle is guaranteed not to be degenerate
            other()->move(_parent->position() - (position() - _parent->position()));
            _parent->setType(NODE_SMOOTH, false);

https://gitlab.com/inkscape/inkscape/blob/masterFix1777530/src/ui/tool/node.cpp#L286

As discussed above, "make smooth" should rotate the opposite control
handle to be collinear with the locked handle, while preserving its
length. The current code instead adjusts the length of the opposite
control handle to be the same as the locked handle. This seems to
contradict the Inkscape manual:

    <Shift+S>: Make selected nodes smooth. When the keyboard shortcut is
    used, placing the mouse over a handle will preserve the position of
    that handle, rotating the partner handle, if extended, to be
    collinear. If the partner handle is not extended, the partner handle
    will be extended so that it is collinear and of the same length as
    the preserved handle.

http://tavmjong.free.fr/INKSCAPE/MANUAL/html/Paths-Editing.html

Presumably, if there were any code for control-handle locking when
converting a node to symmetric, it would be found in the same place. If,
as it appears, no such code exists, that would explain why this alleged
feature does not work, at all.

The attached patch fixes the behaviour of control-handle locking during
conversion to smooth and symmetric path nodes, to conform to what is
described in the keyboard reference and the manual.