diff options
author | Hans Goudey <h.goudey@me.com> | 2020-11-16 19:47:11 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2020-11-16 19:47:11 +0300 |
commit | 328aad8c98c931c3d1850c838c5cb58953ee49cf (patch) | |
tree | d18b5c4b0b07441011959fd0626ed3ee152d5ae9 /source/blender | |
parent | c1d8df47f60f590f0c945ca1ee61adcec226a1b0 (diff) |
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
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/interface/interface_panel.c | 6 |
1 files changed, 1 insertions, 5 deletions
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); |