diff options
author | Charlie Jolly <mistajolly@gmail.com> | 2019-03-04 15:13:35 +0300 |
---|---|---|
committer | Charlie Jolly <mistajolly@gmail.com> | 2019-03-04 15:13:35 +0300 |
commit | ae74f89585380a083cdfc70cf12720fde79f6d26 (patch) | |
tree | e16dd0f0e497785ee079ca1be0fcaf263b3d2bec /source/blender/editors/gpencil | |
parent | baee9b014ab0950db4730439098f35df6ea80291 (diff) |
Fix T62140: GPencil line segment disappears
Remove code for when edge count is 2.
Diffstat (limited to 'source/blender/editors/gpencil')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_primitive.c | 26 |
1 files changed, 8 insertions, 18 deletions
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); |