Page MenuHome

Fix T92427: Adding nodes does no edge-scrolling
ClosedPublic

Authored by Philipp Oeser (lichtwerk) on Oct 26 2021, 1:45 PM.

Details

Summary

Unlike translating existing nodes [which disables cursor wrapping and
enables edge-scrolling instead since rBSa1cc7042a745], adding new nodes
would still show the old behavior of cursor wrapping.

This has been disabled for the case when the node whould be added outside (due to menus overlapping other editors).

Now enable edge-scrolling for adding new nodes as well and make sure
this only starts once the mouse has returned into the inside rect once.

Diff Detail

Repository
rB Blender

Event Timeline

Philipp Oeser (lichtwerk) requested review of this revision.Oct 26 2021, 1:45 PM
Philipp Oeser (lichtwerk) created this revision.
This revision is now accepted and ready to land.Oct 26 2021, 2:42 PM

I actually think this might have been an intentional change in D11736, but I missed that in review, and I think it's weirdly inconsistent.
I also usually want edge panning when adding a node so I can position it correctly. So +1 for adding this pack.

Okay, now I remember why this was changed, it was this situation here:

Often when you added a node the add menu would end up above the node editor, so it would start panning immediately.
I think the one fix is clear though, it should only start panning once the node has been moved back into the view.
The current behavior isn't ideal because it's turned off even when not in that "out of bounds" situation.

only start once the mouse is inside once

Wonderful!

source/blender/editors/interface/view2d_edge_pan.c
244–253

These could be replaced with a check later:

if (!vpd->enabled) {
  return;
}
source/blender/editors/interface/view2d_edge_pan.c
244–253

Think we cannot return right away due to the timers? (but havent checked in full depth), committed with slightly different approach

source/blender/editors/interface/view2d_edge_pan.c
244–253

Ah, you're right, sorry. What you committed looks good.