Page MenuHome

Clamp scrollbar offset to lower view boundaries
ClosedPublic

Authored by Diego Gangl (januz) on Oct 25 2015, 11:20 PM.

Details

Summary

Patch for T45197. Fixes the "emtpy scrolling" glitch by clamping the scroller offset to the boundary of the view when it's smaller than the previous.

Tested:

  • Changing the selected object in properties editor
  • Changing the selected object for n-panels
  • Breaking the draw() code in a panel
  • Horizontal properties editor
  • Changing layers in 3D View with the graph editor open

Diff Detail

Repository
rB Blender
Branch
scroller_bug

Event Timeline

Diego Gangl (januz) retitled this revision from to Let scrollbars reset every time window contents change.
Diego Gangl (januz) updated this object.
Julian Eisel (Severin) requested changes to this revision.Oct 29 2015, 1:49 PM
Julian Eisel (Severin) edited edge metadata.

It's indeed an annoying glitch, but I would solve it a bit differently since the idea of keeping the scroll offset might still be useful.
A better approach might be to change scroll offset so that the lowermost panel is at the lower view boundary, or that scroll offset is set to 0 if totrect is smaller than view boundaries. This way it's ensured that view is filled with as much content possible, without completely destroying previously set scroll offset.

This revision now requires changes to proceed.Oct 29 2015, 1:49 PM
Diego Gangl (januz) edited edge metadata.

Clamps the offset if it's too large, while preserving
it in other cases.

Diego Gangl (januz) edited edge metadata.

I totally forgot horizontal scrollbars in the last rev

Diego Gangl (januz) retitled this revision from Let scrollbars reset every time window contents change to Clamp scrollbar offset to lower view boundaries.Nov 1 2015, 12:18 AM
Diego Gangl (januz) updated this object.

Tested this again against master (A85F4571950). Surprisingly it still applies.
Everything seems to work correctly, it preserves the scroll when it can otherwise it resets.

Here's the blend file I use to test, the 2 suzannes have particles and the cube doesn't (scrollbar resets when clicking it)

This revision now requires changes to proceed.Apr 28 2017, 6:13 PM
Diego Gangl (januz) requested review of this revision.Apr 28 2017, 6:13 PM
Diego Gangl (januz) edited edge metadata.

Rebase against current master

(also friendly ping :) )

Ping!
Hey, this would be a great appetizer before the code quest :)

Am generally a bit wary of such changes in such vital functions, but think this is fine and worth trying. Only briefly tested though ;)

Oh but! Use tabs instead of spaces :P (Can change when committing myself)

source/blender/editors/screen/area.c
1900–1911

Looks like floating point precision checking? Would use FLT_EPSILON here.

This revision is now accepted and ready to land.Apr 8 2018, 5:17 PM
Diego Gangl (januz) marked an inline comment as done.
  • Use FLT_EPSILON for float presicion checking
  • Use tabs instead of spaces :)

Am generally a bit wary of such changes in such vital functions, but think this is fine and worth trying. Only briefly tested though ;)

This indeed touches very vital functions, but it tackles a very bad long-standing issue so I'd shovel it in 2.8 and test it until it's good! :D

Awesome! Thanks for reviewing