[Bf-blender-cvs] [328aad8c98c] master: UI: Remove X axis panel dragging

Hans Goudey noreply at git.blender.org
Mon Nov 16 17:47:17 CET 2020


Commit: 328aad8c98c931c3d1850c838c5cb58953ee49cf
Author: Hans Goudey
Date:   Mon Nov 16 11:47:11 2020 -0500
Branches: master
https://developer.blender.org/rB328aad8c98c931c3d1850c838c5cb58953ee49cf

UI: Remove X axis panel dragging

X axis panel dragging traces back to Blender versions before 2.5,
where panels could be aligned horizontally. But for many years now
panels have been vertically aligned. Considering this, keeping the
X axis dragging around is a bit odd. It makes interaction confusing,
or at least more complicated. It also looks bad, since any part of
the panel outside the region is cropped.

Differential Revision: https://developer.blender.org/D9549

===================================================================

M	source/blender/editors/interface/interface_panel.c

===================================================================

diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c
index ecc22656366..aafc1c53a3b 100644
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@ -1927,20 +1927,16 @@ static void ui_do_drag(const bContext *C, const wmEvent *event, Panel *panel)
   ARegion *region = CTX_wm_region(C);
 
   /* Keep the drag position in the region with a small pad to keep the panel visible. */
-  const int x = clamp_i(event->x, region->winrct.xmin, region->winrct.xmax + DRAG_REGION_PAD);
   const int y = clamp_i(event->y, region->winrct.ymin, region->winrct.ymax + DRAG_REGION_PAD);
 
-  float dx = (float)(x - data->startx);
   float dy = (float)(y - data->starty);
 
   /* Adjust for region zoom. */
-  dx *= BLI_rctf_size_x(&region->v2d.cur) / (float)BLI_rcti_size_x(&region->winrct);
   dy *= BLI_rctf_size_y(&region->v2d.cur) / (float)BLI_rcti_size_y(&region->winrct);
 
   /* Add the movement of the view due to edge scrolling while dragging. */
-  dx += ((float)region->v2d.cur.xmin - data->start_cur_xmin);
   dy += ((float)region->v2d.cur.ymin - data->start_cur_ymin);
-  panel->ofsx = data->startofsx + round_fl_to_int(dx);
+
   panel->ofsy = data->startofsy + round_fl_to_int(dy);
 
   uiAlignPanelStep(region, 0.2f, true);



More information about the Bf-blender-cvs mailing list