[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [48088] branches/soc-2012-bratwurst/source /blender/editors/space_view3d/view3d_edit.c: Brush zoom resize

Antony Riakiotakis kalast at gmail.com
Tue Jun 19 19:22:00 CEST 2012


Revision: 48088
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48088
Author:   psy-fi
Date:     2012-06-19 17:21:59 +0000 (Tue, 19 Jun 2012)
Log Message:
-----------
Brush zoom resize
==================
* Account for float to int conversion and also clamp the result to 5
pixels or scaling up won't work after scaling to a very small size

Modified Paths:
--------------
    branches/soc-2012-bratwurst/source/blender/editors/space_view3d/view3d_edit.c

Modified: branches/soc-2012-bratwurst/source/blender/editors/space_view3d/view3d_edit.c
===================================================================
--- branches/soc-2012-bratwurst/source/blender/editors/space_view3d/view3d_edit.c	2012-06-19 17:21:43 UTC (rev 48087)
+++ branches/soc-2012-bratwurst/source/blender/editors/space_view3d/view3d_edit.c	2012-06-19 17:21:59 UTC (rev 48088)
@@ -1461,7 +1461,9 @@
 	if (brush && (brush->flag & BRUSH_ZOOM_SCALE))
 	{
 		int oldsize = BKE_brush_size_get(scene, brush);
-		BKE_brush_size_set(scene, brush, oldsize*factor);
+		int newsize = oldsize*factor + 0.5;
+		newsize = (newsize > 5)? newsize : 5;
+		BKE_brush_size_set(scene, brush, newsize);
 	}
 }
 




More information about the Bf-blender-cvs mailing list