diff options
author | Antonioya <blendergit@gmail.com> | 2019-01-22 22:13:56 +0300 |
---|---|---|
committer | Antonioya <blendergit@gmail.com> | 2019-01-22 22:14:12 +0300 |
commit | a34297a6d64d1a44a504e93a8a6cd383aa014382 (patch) | |
tree | ead5be22cff42d7ff82506afad9be3a00183612b /source/blender/editors | |
parent | 1ddf93a706d7f914e7bab20083e40130ce60455b (diff) |
GP: Fix UV error for second point
The UV was not calculated for second point (1), only first and > 1
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_paint.c | 4 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_primitive.c | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index eaa5345eae1..e025dd9b261 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -755,9 +755,9 @@ static short gp_stroke_addpoint( pt->time = (float)(curtime - p->inittime); /* point uv (only 3d view) */ - if ((p->sa->spacetype == SPACE_VIEW3D) && (gpd->runtime.sbuffer_size > 1)) { + if ((p->sa->spacetype == SPACE_VIEW3D) && (gpd->runtime.sbuffer_size > 0)) { float pixsize = gp_style->texture_pixsize / 1000000.0f; - tGPspoint *ptb = (tGPspoint *)gpd->runtime.sbuffer + gpd->runtime.sbuffer_size - 2; + tGPspoint *ptb = (tGPspoint *)gpd->runtime.sbuffer + gpd->runtime.sbuffer_size - 1; bGPDspoint spt, spt2; /* get origin to reproject point */ diff --git a/source/blender/editors/gpencil/gpencil_primitive.c b/source/blender/editors/gpencil/gpencil_primitive.c index 67f241531df..a4954100bae 100644 --- a/source/blender/editors/gpencil/gpencil_primitive.c +++ b/source/blender/editors/gpencil/gpencil_primitive.c @@ -926,11 +926,11 @@ static void gp_primitive_update_strokes(bContext *C, tGPDprimitive *tgpi) tpt->strength = strength; tpt->time = p2d->time; - /* point uv (only 3d view) */ - if (gpd->runtime.sbuffer_size > 1) { + /* point uv */ + if (gpd->runtime.sbuffer_size > 0) { MaterialGPencilStyle *gp_style = tgpi->mat->gp_style; const float pixsize = gp_style->texture_pixsize / 1000000.0f; - tGPspoint *tptb = (tGPspoint *)gpd->runtime.sbuffer + gpd->runtime.sbuffer_size - 2; + tGPspoint *tptb = (tGPspoint *)gpd->runtime.sbuffer + gpd->runtime.sbuffer_size - 1; bGPDspoint spt, spt2; /* get origin to reproject point */ |