From 328aad8c98c931c3d1850c838c5cb58953ee49cf Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Mon, 16 Nov 2020 11:47:11 -0500 Subject: 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 --- source/blender/editors/interface/interface_panel.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to '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(®ion->v2d.cur) / (float)BLI_rcti_size_x(®ion->winrct); dy *= BLI_rctf_size_y(®ion->v2d.cur) / (float)BLI_rcti_size_y(®ion->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); -- cgit v1.2.3