Fix #117572: Top vertical scrollbar tool not working properly #117685

Closed
Philipp Oeser wants to merge 3 commits from lichtwerk/blender:117572 into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.

3 Commits

Author SHA1 Message Date
Philipp Oeser 9c382e5c0e address review comments 2024-02-01 14:07:28 +01:00
Philipp Oeser 5f5c042659 Merge branch 'main' into 117572 2024-02-01 13:20:31 +01:00
Philipp Oeser e48f52c43b Fix #117572: Top vertical scrollbar tool not working properly
Followup to ed556113ce

The issue ed556113ce was trying to solve was that custom masks for
scrollers were used for drawing but not for mouse interaction (so
interaction was not matching drawing in some cases, namely the File
Browser and Spreadsheet).

This was done by "re-using" what was written to v2d->hor & v2d->vert (in
drawing) as a new mask (in interaction). This caused a problem since
this already includes not only those custom masks but other stuff, too.
For example, `view2d_masks` shrinks the rect when
V2D_SCROLL_VERTICAL_HANDLES is used, after ed556113ce this was
effectively done twice.

To resolve, revert the way ed556113ce was "re-using" what was written to
v2d->hor & v2d->vert and instead use the exact same masks that the
FileBrowser and the Spreadsheet set up for drawing in mouse interaction
as well. This way the masks match perfectly for both cases (and we can
fully recalculate all v2d extends without reusing anything that we
shouldnt).
2024-01-31 09:18:57 +01:00