summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBen Scholzen 'DASPRiD <mail@dasprids.de>2015-05-20 15:51:48 +0000
committerBen Scholzen 'DASPRiD <mail@dasprids.de>2015-05-20 15:51:48 +0000
commitcb0c46c9678889ce05dedae3ad2569435c7bb969 (patch)
treee126949691de94922c28540802f2c78c6a144467 /src
parentFix locale number handling on powerstroke dialog (diff)
downloadinkscape-cb0c46c9678889ce05dedae3ad2569435c7bb969.tar.gz
inkscape-cb0c46c9678889ce05dedae3ad2569435c7bb969.zip
Use sane constant for min and max values in LPE dialogs
(bzr r14163.1.2)
Diffstat (limited to 'src')
-rw-r--r--src/live_effects/parameter/parameter.cpp7
-rw-r--r--src/live_effects/parameter/parameter.h7
-rw-r--r--src/ui/dialog/lpe-fillet-chamfer-properties.cpp5
-rw-r--r--src/ui/dialog/lpe-powerstroke-properties.cpp5
4 files changed, 13 insertions, 11 deletions
diff --git a/src/live_effects/parameter/parameter.cpp b/src/live_effects/parameter/parameter.cpp
index beb750404..527bc06fe 100644
--- a/src/live_effects/parameter/parameter.cpp
+++ b/src/live_effects/parameter/parameter.cpp
@@ -42,13 +42,6 @@ Parameter::param_write_to_repr(const char * svgd)
param_effect->getRepr()->setAttribute(param_key.c_str(), svgd);
}
-// In gtk2, this wasn't an issue; we could toss around
-// G_MAXDOUBLE and not worry about size allocations. But
-// in gtk3, it is an issue: it allocates widget size for the maxmium
-// value you pass to it, leading to some insane lengths.
-// If you need this to be more, please be conservative about it.
-const double SCALARPARAM_G_MAXDOUBLE = 10000000000.0; // TODO fixme: using an arbitrary large number as a magic value seems fragile.
-
void Parameter::write_to_SVG(void)
{
gchar * str = param_getSVGValue();
diff --git a/src/live_effects/parameter/parameter.h b/src/live_effects/parameter/parameter.h
index 2e6cae49f..cc2c4f3d6 100644
--- a/src/live_effects/parameter/parameter.h
+++ b/src/live_effects/parameter/parameter.h
@@ -13,6 +13,13 @@
#include <2geom/forward.h>
#include <2geom/pathvector.h>
+// In gtk2, this wasn't an issue; we could toss around
+// G_MAXDOUBLE and not worry about size allocations. But
+// in gtk3, it is an issue: it allocates widget size for the maxmium
+// value you pass to it, leading to some insane lengths.
+// If you need this to be more, please be conservative about it.
+const double SCALARPARAM_G_MAXDOUBLE = 10000000000.0; // TODO fixme: using an arbitrary large number as a magic value seems fragile.
+
class KnotHolder;
class SPLPEItem;
class SPDesktop;
diff --git a/src/ui/dialog/lpe-fillet-chamfer-properties.cpp b/src/ui/dialog/lpe-fillet-chamfer-properties.cpp
index 061055feb..5ccee103c 100644
--- a/src/ui/dialog/lpe-fillet-chamfer-properties.cpp
+++ b/src/ui/dialog/lpe-fillet-chamfer-properties.cpp
@@ -27,6 +27,7 @@
#include "selection-chemistry.h"
#include "ui/icon-names.h"
#include "ui/widget/imagetoggler.h"
+#include "live_effects/parameter/parameter.h"
#include <cmath>
//#include "event-context.h"
@@ -47,7 +48,7 @@ FilletChamferPropertiesDialog::FilletChamferPropertiesDialog()
_fillet_chamfer_position_numeric.set_digits(4);
_fillet_chamfer_position_numeric.set_increments(1,1);
//todo: get tha max aloable infinity freeze the widget
- _fillet_chamfer_position_numeric.set_range(0., 999999999999999999.);
+ _fillet_chamfer_position_numeric.set_range(0., SCALARPARAM_G_MAXDOUBLE);
_fillet_chamfer_position_label.set_label(_("Radius (pixels):"));
_fillet_chamfer_position_label.set_alignment(1.0, 0.5);
@@ -59,7 +60,7 @@ FilletChamferPropertiesDialog::FilletChamferPropertiesDialog()
_fillet_chamfer_chamfer_subdivisions.set_digits(0);
_fillet_chamfer_chamfer_subdivisions.set_increments(1,1);
//todo: get tha max aloable infinity freeze the widget
- _fillet_chamfer_chamfer_subdivisions.set_range(0, 999999999999999999.0);
+ _fillet_chamfer_chamfer_subdivisions.set_range(0, SCALARPARAM_G_MAXDOUBLE);
_fillet_chamfer_chamfer_subdivisions_label.set_label(_("Chamfer subdivisions:"));
_fillet_chamfer_chamfer_subdivisions_label.set_alignment(1.0, 0.5);
diff --git a/src/ui/dialog/lpe-powerstroke-properties.cpp b/src/ui/dialog/lpe-powerstroke-properties.cpp
index aa2b3cb72..cfc972547 100644
--- a/src/ui/dialog/lpe-powerstroke-properties.cpp
+++ b/src/ui/dialog/lpe-powerstroke-properties.cpp
@@ -36,6 +36,7 @@
#include "selection-chemistry.h"
#include "ui/icon-names.h"
#include "ui/widget/imagetoggler.h"
+#include "live_effects/parameter/parameter.h"
//#include "event-context.h"
namespace Inkscape {
@@ -54,14 +55,14 @@ PowerstrokePropertiesDialog::PowerstrokePropertiesDialog()
_powerstroke_position_entry.set_activates_default(true);
_powerstroke_position_entry.set_digits(4);
_powerstroke_position_entry.set_increments(1,1);
- _powerstroke_position_entry.set_range(-999999999999999999., 999999999999999999.);
+ _powerstroke_position_entry.set_range(-SCALARPARAM_G_MAXDOUBLE, SCALARPARAM_G_MAXDOUBLE);
_powerstroke_position_label.set_label(_("Position:"));
_powerstroke_position_label.set_alignment(1.0, 0.5);
_powerstroke_width_entry.set_activates_default(true);
_powerstroke_width_entry.set_digits(4);
_powerstroke_width_entry.set_increments(1,1);
- _powerstroke_width_entry.set_range(-999999999999999999., 999999999999999999.);
+ _powerstroke_width_entry.set_range(-SCALARPARAM_G_MAXDOUBLE, SCALARPARAM_G_MAXDOUBLE);
_powerstroke_width_label.set_label(_("Width:"));
_powerstroke_width_label.set_alignment(1.0, 0.5);