[Bf-blender-cvs] [bb0dee2] temp-curve-draw: Scale the error threshold by the user-prefs pixelsize

Campbell Barton noreply at git.blender.org
Thu Apr 14 23:53:45 CEST 2016


Commit: bb0dee23a86919ec50b3416d779aea1af4b7d21a
Author: Campbell Barton
Date:   Fri Apr 15 07:53:33 2016 +1000
Branches: temp-curve-draw
https://developer.blender.org/rBbb0dee23a86919ec50b3416d779aea1af4b7d21a

Scale the error threshold by the user-prefs pixelsize

===================================================================

M	source/blender/editors/curve/editcurve_paint.c
M	source/blender/makesdna/DNA_scene_types.h

===================================================================

diff --git a/source/blender/editors/curve/editcurve_paint.c b/source/blender/editors/curve/editcurve_paint.c
index ddb0e74..a7375a6 100644
--- a/source/blender/editors/curve/editcurve_paint.c
+++ b/source/blender/editors/curve/editcurve_paint.c
@@ -660,9 +660,8 @@ static int curve_draw_exec(bContext *C, wmOperator *op)
 				selem_prev = selem;
 			}
 			scale_px = ((len_3d > 0.0f) && (len_2d > 0.0f)) ?  (len_3d / len_2d) : 0.0f;
-			error_threshold = (float)cps->error_threshold * scale_px;
+			error_threshold = (cps->error_threshold * U.pixelsize) * scale_px;
 			RNA_property_float_set(op->ptr, prop_error, error_threshold);
-			printf("%.6f ~ %.6f ~ %.6f\n", scale_px, len_3d, len_2d);
 		}
 
 		{
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index 1520514..4340c24 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -1269,26 +1269,29 @@ typedef enum {
 
 typedef struct CurvePaintSettings {
 	char curve_type;
+	char flag;
 	char depth_mode;
 	char surface_plane;
-	char flag;
 	int error_threshold;
 	float radius_min, radius_max;
 	float radius_offset;
 	float corner_angle;
 } CurvePaintSettings;
 
+/* CurvePaintSettings.flag */
 enum {
 	CURVE_PAINT_FLAG_CORNERS_DETECT			= (1 << 0),
 	CURVE_PAINT_FLAG_PRESSURE_RADIUS		= (1 << 1),
 	CURVE_PAINT_FLAG_DEPTH_STROKE_ENDPOINTS	= (1 << 2),
 };
 
+/* CurvePaintSettings.depth_mode */
 enum {
 	CURVE_PAINT_PROJECT_CURSOR		= 0,
 	CURVE_PAINT_PROJECT_SURFACE		= 1,
 };
 
+/* CurvePaintSettings.surface_plane */
 enum {
 	CURVE_PAINT_SURFACE_PLANE_NORMAL_VIEW		= 0,
 	CURVE_PAINT_SURFACE_PLANE_NORMAL_SURFACE	= 1,




More information about the Bf-blender-cvs mailing list