[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [53753] trunk/blender/source/blender/ editors/interface/interface_templates.c: fix [#33846] Points of Curves in Vector Curves node can't have negative X or Y values/.

Campbell Barton ideasman42 at gmail.com
Sat Jan 12 21:20:01 CET 2013


Revision: 53753
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=53753
Author:   campbellbarton
Date:     2013-01-12 20:19:58 +0000 (Sat, 12 Jan 2013)
Log Message:
-----------
fix [#33846] Points of Curves in Vector Curves node can't have negative X or Y values/.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/interface/interface_templates.c

Modified: trunk/blender/source/blender/editors/interface/interface_templates.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_templates.c	2013-01-12 20:01:58 UTC (rev 53752)
+++ trunk/blender/source/blender/editors/interface/interface_templates.c	2013-01-12 20:19:58 UTC (rev 53753)
@@ -2020,16 +2020,22 @@
 	}
 
 	if (cmp) {
-		const float range_clamp[2]   = {0.0f, 1.0f};
-		const float range_unclamp[2] = {-1000.0f, 1000.0f};  /* arbitrary limits here */
-		const float *range = (cumap->flag & CUMA_DO_CLIP) ? range_clamp : range_unclamp;
+		rctf bounds;
 
+		if (cumap->flag & CUMA_DO_CLIP) {
+			bounds = cumap->clipr;
+		}
+		else {
+			bounds.xmin = bounds.ymin = -1000.0;
+			bounds.xmax = bounds.ymax =  1000.0;
+		}
+
 		uiLayoutRow(layout, TRUE);
 		uiBlockSetNFunc(block, curvemap_buttons_update, MEM_dupallocN(cb), cumap);
 		bt = uiDefButF(block, NUM, 0, "X", 0, 2 * UI_UNIT_Y, UI_UNIT_X * 10, UI_UNIT_Y,
-		               &cmp->x, range[0], range[1], 1, 5, "");
+		               &cmp->x, bounds.xmin, bounds.xmax, 1, 5, "");
 		bt = uiDefButF(block, NUM, 0, "Y", 0, 1 * UI_UNIT_Y, UI_UNIT_X * 10, UI_UNIT_Y,
-		               &cmp->y, range[0], range[1], 1, 5, "");
+		               &cmp->y, bounds.ymin, bounds.ymax, 1, 5, "");
 	}
 
 	/* black/white levels */




More information about the Bf-blender-cvs mailing list