Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Eisel <eiseljulian@gmail.com>2018-12-24 00:31:04 +0300
committerJulian Eisel <eiseljulian@gmail.com>2018-12-24 00:42:01 +0300
commite5e885d0ecb9430a73e0a904cdb6035a2ef77e98 (patch)
treebd288231bb3957b2e628489db52ed876ffa1a264 /source/blender/editors/screen/area.c
parent59b530ca1810f109c3696814655e427d912ad6b7 (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/blender/editors/screen/area.c')
-rw-r--r--source/blender/editors/screen/area.c10
1 files changed, 5 insertions, 5 deletions
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) {