diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2018-12-24 00:31:04 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2018-12-24 00:42:01 +0300 |
commit | e5e885d0ecb9430a73e0a904cdb6035a2ef77e98 (patch) | |
tree | bd288231bb3957b2e628489db52ed876ffa1a264 /source | |
parent | 59b530ca1810f109c3696814655e427d912ad6b7 (diff) |
Fix floating panel (HUD) applying DPI incorrectly
ARegion.sizex/y should never have DPI factor applied. For regular panel
regions, DPI will be applied in region_rect_recursive already, causing
it to be applied twice when region size is set dynamically (= based on
content dimensions).
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/interface/interface_region_hud.c | 4 | ||||
-rw-r--r-- | source/blender/editors/screen/area.c | 10 |
2 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/editors/interface/interface_region_hud.c b/source/blender/editors/interface/interface_region_hud.c index 0a5a88f2cb6..c30958a4d3a 100644 --- a/source/blender/editors/interface/interface_region_hud.c +++ b/source/blender/editors/interface/interface_region_hud.c @@ -188,8 +188,8 @@ static void hud_region_layout(const bContext *C, ARegion *ar) if (ar->panels.first && (ar->sizey != size_y)) { View2D *v2d = &ar->v2d; - ar->winx = ar->sizex; - ar->winy = ar->sizey; + ar->winx = ar->sizex * UI_DPI_FAC; + ar->winy = ar->sizey * UI_DPI_FAC; ar->winrct.xmax = (ar->winrct.xmin + ar->winx) - 1; ar->winrct.ymax = (ar->winrct.ymin + ar->winy) - 1; diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 43ff12540db..47c44468bc7 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -1250,8 +1250,8 @@ static void region_rect_recursive(ScrArea *sa, ARegion *ar, rcti *remainder, rct max_ii(0, BLI_rcti_size_y(overlap_remainder) - UI_UNIT_Y / 2)); ar->winrct.xmin = overlap_remainder_margin.xmin; ar->winrct.ymin = overlap_remainder_margin.ymin; - ar->winrct.xmax = ar->winrct.xmin + ar->sizex - 1; - ar->winrct.ymax = ar->winrct.ymin + ar->sizey - 1; + ar->winrct.xmax = ar->winrct.xmin + prefsizex - 1; + ar->winrct.ymax = ar->winrct.ymin + prefsizey - 1; BLI_rcti_isect(&ar->winrct, &overlap_remainder_margin, &ar->winrct); @@ -2308,8 +2308,8 @@ void ED_region_panels_layout_ex( Panel *panel = ar->panels.last; if (panel != NULL) { int size_dyn[2] = { - UI_UNIT_X * ((panel->flag & PNL_CLOSED) ? 8 : 14), - UI_panel_size_y(panel), + UI_UNIT_X * ((panel->flag & PNL_CLOSED) ? 8 : 14) / UI_DPI_FAC, + UI_panel_size_y(panel) / UI_DPI_FAC, }; /* region size is layout based and needs to be updated */ if ((ar->sizex != size_dyn[0]) || @@ -2319,7 +2319,7 @@ void ED_region_panels_layout_ex( ar->sizey = size_dyn[1]; sa->flag |= AREA_FLAG_REGION_SIZE_UPDATE; } - y = ABS(ar->sizey - 1); + y = ABS(ar->sizey * UI_DPI_FAC - 1); } } else if (vertical) { |