This confuses me, tho. the dragged component is only 20x20. so, maybe it should be
edit: ok, after playing with it for a while, what I had to do was this:
if( node == startNode )
constrainer.applyBoundsToComponent(*node, node->getBounds().withX(1 + node->NodeDiameter/2));
that keeps the node’s X at the position it’s originally positioned at.
It seems like this ComponentBoundsConstrainer class could really use a
limitComponentPosition(Component&, Rectangle<int> ) method as that’s how most of us want to use it, and no one has figured out how to do that with the current class member functions. Most of those member functions actually end up resizing the component that’s being constrained, not just limiting the position.
Suggested addition to the framework:
or, if one already exists, point us to it, and a usage example