[Bf-blender-cvs] [cf64a83edc2] blender2.8: UI: Fix area border thickness over top and bottom bar with glScissors

Clément Foucault noreply at git.blender.org
Thu Aug 23 23:02:51 CEST 2018


Commit: cf64a83edc2621aaeafed417f22081ef7b81ad1b
Author: Clément Foucault
Date:   Thu Aug 23 23:02:38 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBcf64a83edc2621aaeafed417f22081ef7b81ad1b

UI: Fix area border thickness over top and bottom bar with glScissors

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

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

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

diff --git a/source/blender/editors/screen/screen_draw.c b/source/blender/editors/screen/screen_draw.c
index 60fe1dfa483..5371fcfd6d4 100644
--- a/source/blender/editors/screen/screen_draw.c
+++ b/source/blender/editors/screen/screen_draw.c
@@ -221,8 +221,8 @@ static void draw_join_shape(ScrArea *sa, char dir, unsigned int pos)
 static void do_vert_pair(GPUVertBuf *vbo, uint pos, uint *vidx, int corner, int i)
 {
 	float inter[2], exter[2];
-	inter[0] = cosf((corner * 2.0f * M_PI / 4.0f) + (i * M_PI_2 / (CORNER_RESOLUTION - 1.0f)));
-	inter[1] = sinf((corner * 2.0f * M_PI / 4.0f) + (i * M_PI_2 / (CORNER_RESOLUTION - 1.0f)));
+	inter[0] = cosf(corner * M_PI_2 + (i * M_PI_2 / (CORNER_RESOLUTION - 1.0f)));
+	inter[1] = sinf(corner * M_PI_2 + (i * M_PI_2 / (CORNER_RESOLUTION - 1.0f)));
 
 	/* Snap point to edge */
 	float div = 1.0f / max_ff(fabsf(inter[0]), fabsf(inter[1]));
@@ -377,6 +377,20 @@ void ED_screen_draw_edges(wmWindow *win)
 
 	ScrArea *sa;
 
+	rcti scissor_rect;
+	BLI_rcti_init_minmax(&scissor_rect);
+	for (sa = screen->areabase.first; sa; sa = sa->next) {
+		BLI_rcti_do_minmax_v(&scissor_rect, (int[2]){sa->v1->vec.x, sa->v1->vec.y});
+		BLI_rcti_do_minmax_v(&scissor_rect, (int[2]){sa->v3->vec.x, sa->v3->vec.y});
+	}
+
+	GPU_scissor(scissor_rect.xmin,
+	            scissor_rect.ymin,
+	            BLI_rcti_size_x(&scissor_rect) + 1,
+	            BLI_rcti_size_y(&scissor_rect) + 1);
+
+	glEnable(GL_SCISSOR_TEST);
+
 	UI_GetThemeColor4fv(TH_EDITOR_OUTLINE, col);
 	col[3] = 1.0f / 8.0f;
 	corner_scale = U.pixelsize * 8.0f;
@@ -406,6 +420,8 @@ void ED_screen_draw_edges(wmWindow *win)
 		drawscredge_area(sa, winsize_x, winsize_y, edge_thickness);
 	}
 
+	glDisable(GL_SCISSOR_TEST);
+
 	screen->do_draw = false;
 }



More information about the Bf-blender-cvs mailing list