[Bf-blender-cvs] [08258f92e4e] topbar: Workaround for 1 px button alignment issue

Julian Eisel noreply at git.blender.org
Fri Oct 27 15:45:44 CEST 2017


Commit: 08258f92e4e8c4074b6c92ff3cff98cc2a8c186d
Author: Julian Eisel
Date:   Fri Oct 27 15:41:33 2017 +0200
Branches: topbar
https://developer.blender.org/rB08258f92e4e8c4074b6c92ff3cff98cc2a8c186d

Workaround for 1 px button alignment issue

Needed to offset layout by one pixel to the right and top. Spent hours
debugging what causes this, without luck. For now a stupid workaround
should do it.

===================================================================

M	source/blender/editors/screen/area.c

===================================================================

diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index 57bb2646722..e5ed2ff1d67 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -2138,6 +2138,12 @@ void ED_region_header(const bContext *C, ARegion *ar)
 	xco = maxco = start_ofs;
 	yco = headery - floor(0.2f * UI_UNIT_Y);
 
+	/* XXX workaround for 1 px alignment issue. Not sure what causes it... Would prefer a proper fix - Julian */
+	if (CTX_wm_area(C)->spacetype == SPACE_TOPBAR) {
+		xco += 1;
+		yco += 1;
+	}
+
 	/* draw all headers types */
 	for (ht = ar->type->headertypes.first; ht; ht = ht->next) {
 		block = UI_block_begin(C, ar, ht->idname, UI_EMBOSS);



More information about the Bf-blender-cvs mailing list