[Bf-blender-cvs] [ae74f895853] master: Fix T62140: GPencil line segment disappears

Charlie Jolly noreply at git.blender.org
Mon Mar 4 13:13:46 CET 2019


Commit: ae74f89585380a083cdfc70cf12720fde79f6d26
Author: Charlie Jolly
Date:   Mon Mar 4 12:13:35 2019 +0000
Branches: master
https://developer.blender.org/rBae74f89585380a083cdfc70cf12720fde79f6d26

Fix T62140: GPencil line segment disappears

Remove code for when edge count is 2.

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

M	source/blender/editors/gpencil/gpencil_primitive.c

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

diff --git a/source/blender/editors/gpencil/gpencil_primitive.c b/source/blender/editors/gpencil/gpencil_primitive.c
index f03b2b4aca1..a7f0d2c47f4 100644
--- a/source/blender/editors/gpencil/gpencil_primitive.c
+++ b/source/blender/editors/gpencil/gpencil_primitive.c
@@ -522,26 +522,16 @@ static void gp_primitive_rectangle(tGPDprimitive *tgpi, tGPspoint *points2D)
 /* create a line */
 static void gp_primitive_line(tGPDprimitive *tgpi, tGPspoint *points2D)
 {
-	if (tgpi->tot_edges == 2) {
-		int i = tgpi->tot_stored_edges;
-
-		points2D[i].x = tgpi->start[0];
-		points2D[i].y = tgpi->start[1];
-
-		points2D[i + 1].x = tgpi->end[0];
-		points2D[i + 1].y = tgpi->end[1];
-	}
-	else {
-		const int totpoints = (tgpi->tot_edges + tgpi->tot_stored_edges);
-		const float step = 1.0f / (float)(tgpi->tot_edges - 1);
-		float a = tgpi->tot_stored_edges ? step : 0.0f;
+	const int totpoints = (tgpi->tot_edges + tgpi->tot_stored_edges);
+	const float step = 1.0f / (float)(tgpi->tot_edges - 1);
+	float a = tgpi->tot_stored_edges ? step : 0.0f;
 
-		for (int i = tgpi->tot_stored_edges; i < totpoints; i++) {
-			tGPspoint *p2d = &points2D[i];
-			interp_v2_v2v2(&p2d->x, tgpi->start, tgpi->end, a);
-			a += step;
-		}
+	for (int i = tgpi->tot_stored_edges; i < totpoints; i++) {
+		tGPspoint *p2d = &points2D[i];
+		interp_v2_v2v2(&p2d->x, tgpi->start, tgpi->end, a);
+		a += step;
 	}
+	
 	float color[4];
 	UI_GetThemeColor4fv(TH_GIZMO_PRIMARY, color);
 	gp_primitive_set_cp(tgpi, tgpi->end, color, BIG_SIZE_CTL);



More information about the Bf-blender-cvs mailing list