Page Menu
Home
Search
Configure Global Search
Log In
Paste
P3208
Fix T72392: Resizing Outliner moves the scroll position
Archived
Public
Actions
Authored by
Campbell Barton (campbellbarton)
on Sep 22 2022, 7:42 AM.
Edit Paste
Activate Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Tags
None
Subscribers
None
commit 1ec2a776bde15fc2748979f01c037cf857c737fa
Author: Campbell Barton <campbell@blender.org>
Date: Thu Sep 22 15:37:55 2022 +1000
Fix T72392: Resizing Outliner moves the scroll position
Enable V2D_KEEPOFS_X/Y for V2D_COMMONVIEW_STACK & V2D_COMMONVIEW_HEADER.
diff --git a/source/blender/editors/interface/view2d.cc b/source/blender/editors/interface/view2d.cc
index 95e5c0ad7d8..b6cbb2c5859 100644
--- a/source/blender/editors/interface/view2d.cc
+++ b/source/blender/editors/interface/view2d.cc
@@ -278,6 +278,7 @@ void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy)
/* tot rect has strictly regulated placement, and must only occur in +/+ quadrant */
v2d->align = (V2D_ALIGN_NO_NEG_X | V2D_ALIGN_NO_NEG_Y);
v2d->keeptot = V2D_KEEPTOT_STRICT;
+ v2d->keepofs = (V2D_KEEPOFS_X | V2D_KEEPOFS_Y);
tot_changed = do_init;
/* scroller settings are currently not set here... that is left for regions... */
@@ -303,6 +304,7 @@ void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy)
/* tot rect has strictly regulated placement, and must only occur in +/+ quadrant */
v2d->align = (V2D_ALIGN_NO_NEG_X | V2D_ALIGN_NO_NEG_Y);
v2d->keeptot = V2D_KEEPTOT_STRICT;
+ v2d->keepofs = (V2D_KEEPOFS_X | V2D_KEEPOFS_Y);
tot_changed = do_init;
/* panning in y-axis is prohibited */
@@ -534,7 +536,8 @@ static void ui_view2d_curRect_validate_resize(View2D *v2d, bool resize)
/* do_win = do_y; */ /* UNUSED */
if (do_cur) {
- if ((v2d->keeptot == V2D_KEEPTOT_STRICT) && (winx != v2d->oldwinx)) {
+ if ((v2d->keeptot == V2D_KEEPTOT_STRICT) && ((v2d->keepofs & V2D_KEEPOFS_X) == 0) &&
+ (winx != v2d->oldwinx)) {
/* Special exception for Outliner (and later channel-lists):
* - The view may be moved left to avoid contents
* being pushed out of view when view shrinks.
@@ -559,7 +562,8 @@ static void ui_view2d_curRect_validate_resize(View2D *v2d, bool resize)
}
}
else {
- if ((v2d->keeptot == V2D_KEEPTOT_STRICT) && (winy != v2d->oldwiny)) {
+ if ((v2d->keeptot == V2D_KEEPTOT_STRICT) && ((v2d->keepofs & V2D_KEEPOFS_Y) == 0) &&
+ (winy != v2d->oldwiny)) {
/* special exception for Outliner (and later channel-lists):
* - Currently, no actions need to be taken here...
*/
Event Timeline
Campbell Barton (campbellbarton)
created this paste.
Sep 22 2022, 7:42 AM
Campbell Barton (campbellbarton)
changed the title of this paste from untitled to
Fix T72392: Resizing Outliner moves the scroll position
.
Campbell Barton (campbellbarton)
edited the content of this paste.
(Show Details)
Sep 22 2022, 7:47 AM
Campbell Barton (campbellbarton)
edited the content of this paste.
(Show Details)
Campbell Barton (campbellbarton)
mentioned this in
D15873: Fix T100141: Header Alignment of New Editors
.
Sep 22 2022, 7:50 AM
Campbell Barton (campbellbarton)
archived this paste.
Sep 23 2022, 6:46 AM
Log In to Comment