[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [56423] trunk/blender/source/blender/ editors/sculpt_paint/paint_image_2d.c: Fix tiled overlay not matching up with stroke result in 2d painting.

Antony Riakiotakis kalast at gmail.com
Wed May 1 00:14:19 CEST 2013


Revision: 56423
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=56423
Author:   psy-fi
Date:     2013-04-30 22:14:19 +0000 (Tue, 30 Apr 2013)
Log Message:
-----------
Fix tiled overlay not matching up with stroke result in 2d painting.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/sculpt_paint/paint_image_2d.c

Modified: trunk/blender/source/blender/editors/sculpt_paint/paint_image_2d.c
===================================================================
--- trunk/blender/source/blender/editors/sculpt_paint/paint_image_2d.c	2013-04-30 21:17:21 UTC (rev 56422)
+++ trunk/blender/source/blender/editors/sculpt_paint/paint_image_2d.c	2013-04-30 22:14:19 UTC (rev 56423)
@@ -831,9 +831,13 @@
 	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);




More information about the Bf-blender-cvs mailing list