Page MenuHome

Node Resizing Hit Area

Authored by Harley Acheson (harley) on Nov 27 2018, 5:32 AM.



When you move your mouse to the sides of a node the cursor changes into a "move" cursor and you can drag the edge left or right.

Unfortunately, that area is too wide and is only within the node contents area. The following image illustrates the current area on the left:

In a nutshell it starts in the middle of the border and extends into the content by 10 units. The biggest problem with this is that it will sometimes keep some content from working correctly if that area and the sizing area overlap. An example is the left side of the ColorRamp, which you cannot move.

The attached patch alters this so that the hit area is centered over the border, so works from the same distance on the left or right of the border. Specifically it makes it work from 3 units to the left to 3 units to the right, so still 6 units wide in total. The result is (roughly) illustrated by the right side of the attached image

Diff Detail

rB Blender

Event Timeline

Brecht Van Lommel (brecht) requested changes to this revision.Dec 7 2018, 1:46 AM

Dragging from just outside the node shows the cursor but starts a box select.


This should be multiplied with UI_DPI_FAC. It was wrong already, but 3px is quite small on a retina screen.

1166 ↗(On Diff #12681)

Shouldn't this be 3px like above?

Probably to be shared with a single #define.

This revision now requires changes to proceed.Dec 7 2018, 1:46 AM

Actually the new left-click drag wrecks my idea of having the drag area start outside of the node. Which is fine since I love the new left click stuff.

This patch then just defines a NODE_RESIZE_MARGIN in node_intern.h so it can be easily changed.

The drag still only works within the node bounds, not outside of it. But it is scaled correctly and is about half as wide as it was before. Therefore it does not interfere with node contents.

So with ColorRamp you can, once again, grab the handles when they are at either end of the ramp. But resizing is still easy to do, no matter what the zoom level.

This revision is now accepted and ready to land.Jan 4 2019, 3:16 PM
This revision was automatically updated to reflect the committed changes.