From b1985b0ec045e42934ff801a3f0de70f7405ee11 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Tue, 7 Jul 2009 02:00:16 +0000 Subject: Fix LP #390162: Wrong defaults for Calligraphy tool (bzr r8223) --- src/common-context.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/common-context.cpp') diff --git a/src/common-context.cpp b/src/common-context.cpp index 48a7f308c..2229f3a23 100644 --- a/src/common-context.cpp +++ b/src/common-context.cpp @@ -166,19 +166,20 @@ static void sp_common_context_set(SPEventContext *ec, Inkscape::Preferences::Ent if (full_path.compare(0, presets_path.size(), presets_path) == 0) return; if (path == "mass") { - ctx->mass = CLAMP(value->getDouble(0.2), -1000.0, 1000.0); + ctx->mass = 0.01 * CLAMP(value->getInt(10), 0, 100); } else if (path == "wiggle") { - ctx->drag = CLAMP((1 - value->getDouble(1 - DRAG_DEFAULT)), DRAG_MIN, DRAG_MAX); // drag is inverse to wiggle + ctx->drag = CLAMP((1 - 0.01 * value->getInt()), + DRAG_MIN, DRAG_MAX); // drag is inverse to wiggle } else if (path == "angle") { ctx->angle = CLAMP(value->getDouble(), -90, 90); } else if (path == "width") { - ctx->width = CLAMP(value->getDouble(0.1), -1000.0, 1000.0); + ctx->width = 0.01 * CLAMP(value->getInt(10), 1, 100); } else if (path == "thinning") { - ctx->vel_thin = CLAMP(value->getDouble(0.1), -1.0, 1.0); + ctx->vel_thin = 0.01 * CLAMP(value->getInt(10), -100, 100); } else if (path == "tremor") { - ctx->tremor = CLAMP(value->getDouble(), 0.0, 1.0); + ctx->tremor = 0.01 * CLAMP(value->getInt(), 0, 100); } else if (path == "flatness") { - ctx->flatness = CLAMP(value->getDouble(1.0), 0, 1.0); + ctx->flatness = 0.01 * CLAMP(value->getInt(), 0, 100); } else if (path == "usepressure") { ctx->usepressure = value->getBool(); } else if (path == "usetilt") { -- cgit v1.2.3