diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2013-05-01 02:14:19 +0400 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2013-05-01 02:14:19 +0400 |
commit | 2caeb1517ce793ce9c9ddd0b1bb121b24c5d2331 (patch) | |
tree | 64f9d6abe984d8c9f76d1d731d17ac03b1cc870a /source/blender/editors/sculpt_paint/paint_image_2d.c | |
parent | d3fdb4c582a1441fa22630827c96dccf262ca365 (diff) |
Fix tiled overlay not matching up with stroke result in 2d painting.
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_image_2d.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_image_2d.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image_2d.c b/source/blender/editors/sculpt_paint/paint_image_2d.c index 02bdd974aa2..5db8c41a059 100644 --- a/source/blender/editors/sculpt_paint/paint_image_2d.c +++ b/source/blender/editors/sculpt_paint/paint_image_2d.c @@ -831,9 +831,13 @@ int paint_2d_stroke(void *ps, const int prev_mval[2], const int mval[2], int era olduv[1] *= ibuf->y; if (painter->firsttouch) { + float startuv[2]; + + UI_view2d_region_to_view(s->v2d, 0, 0, &startuv[0], &startuv[1]); + /* paint exactly once on first touch */ - painter->startpaintpos[0] = newuv[0]; - painter->startpaintpos[1] = newuv[1]; + painter->startpaintpos[0] = startuv[0]*ibuf->x; + painter->startpaintpos[1] = startuv[1]*ibuf->y; painter->firsttouch = 0; copy_v2_v2(painter->lastpaintpos, newuv); |