[Bf-blender-cvs] [9f9866b6175] topbar: Remove redundant setting of area size; Add comments
Julian Eisel
noreply at git.blender.org
Wed Aug 2 03:25:57 CEST 2017
Commit: 9f9866b6175c8ea1866ee78d357bffb90a80bb20
Author: Julian Eisel
Date: Wed Aug 2 03:24:46 2017 +0200
Branches: topbar
https://developer.blender.org/rB9f9866b6175c8ea1866ee78d357bffb90a80bb20
Remove redundant setting of area size; Add comments
===================================================================
M source/blender/blenloader/intern/versioning_280.c
M source/blender/editors/screen/screen_edit.c
===================================================================
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index 806efcd66ba..5a6fb3408c6 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -325,7 +325,6 @@ void do_versions_after_linking_280(Main *main)
}
if (!MAIN_VERSION_ATLEAST(main, 280, 2)) {
- const float dpi_fac = (U.pixelsize * (float)U.dpi / 72.0f); /* UI_DPI_FAC */
const short size_y = 2 * HEADERY;
for (wmWindowManager *wm = main->wm.first; wm; wm = wm->id.next) {
@@ -342,11 +341,7 @@ void do_versions_after_linking_280(Main *main)
sa->v2 = MEM_callocN(sizeof(*sa->v2), "do_version topbar vert");
sa->v3 = MEM_callocN(sizeof(*sa->v3), "do_version topbar vert");
sa->v4 = MEM_callocN(sizeof(*sa->v4), "do_version topbar vert");
-
- sa->v1->vec.x = sa->v2->vec.x = 0;
- sa->v3->vec.x = sa->v4->vec.x = win->sizex;
- sa->v1->vec.y = sa->v4->vec.y = win->sizey - size_y * dpi_fac;
- sa->v2->vec.y = sa->v3->vec.y = win->sizey;
+ /* Actual coordinates of area verts are set later (screen_test_scale) */
sa->spacetype = sa->butspacetype = SPACE_TOPBAR;
sa->fixed_height = size_y;
diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c
index 7065f56b4a7..e11a660e9de 100644
--- a/source/blender/editors/screen/screen_edit.c
+++ b/source/blender/editors/screen/screen_edit.c
@@ -679,6 +679,7 @@ static void screen_test_scale(const wmWindow *win, bScreen *sc, int winsize_x, i
}
}
+ /* Global areas have a fixed size that only changes with the DPI. Here we ensure that exactly this size is set. */
for (ScrArea *area = win->global_areas.first; area; area = area->next) {
short px = (short)U.pixelsize;
@@ -1102,11 +1103,7 @@ void ED_screen_global_areas_create(const bContext *C, wmWindow *win)
sa->v2 = MEM_callocN(sizeof(*sa->v2), __func__);
sa->v3 = MEM_callocN(sizeof(*sa->v3), __func__);
sa->v4 = MEM_callocN(sizeof(*sa->v4), __func__);
-
- sa->v1->vec.x = sa->v2->vec.x = 0;
- sa->v3->vec.x = sa->v4->vec.x = win->sizex;
- sa->v1->vec.y = sa->v4->vec.y = win->sizey - size_y * UI_DPI_FAC;
- sa->v2->vec.y = sa->v3->vec.y = win->sizey;
+ /* Actual coordinates of area verts are set later (screen_test_scale) */
sa->spacetype = sa->butspacetype = SPACE_TOPBAR;
sa->fixed_height = size_y;
More information about the Bf-blender-cvs
mailing list