summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLiam P. White <inkscapebronyat-signgmaildotcom>2014-07-06 15:39:19 +0000
committerLiam P. White <inkscapebronyat-signgmaildotcom>2014-07-06 15:39:19 +0000
commitf021bb175a1d26ffe8f51df479c3cc23abfbbde4 (patch)
tree547fb6ac4846275fcbb27f2551a975679c454d1d /src
parentFix an oddity with path effects dialog, gtk3 only (diff)
downloadinkscape-f021bb175a1d26ffe8f51df479c3cc23abfbbde4.tar.gz
inkscape-f021bb175a1d26ffe8f51df479c3cc23abfbbde4.zip
Extension of fix for 13420: effects often set upper limit to inf, causing problems in gtk3
(bzr r13341.1.80)
Diffstat (limited to 'src')
-rw-r--r--src/live_effects/parameter/parameter.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/live_effects/parameter/parameter.cpp b/src/live_effects/parameter/parameter.cpp
index 401d89884..7732eee76 100644
--- a/src/live_effects/parameter/parameter.cpp
+++ b/src/live_effects/parameter/parameter.cpp
@@ -48,6 +48,7 @@ Parameter::param_write_to_repr(const char * svgd)
// 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;
@@ -116,8 +117,22 @@ ScalarParam::param_set_value(gdouble val)
void
ScalarParam::param_set_range(gdouble min, gdouble max)
{
- this->min = min;
- this->max = max;
+ // if you look at client code, you'll see that many effects
+ // has a tendency to set an upper range of Geom::infinity().
+ // Once again, in gtk2, this is not a problem. But in gtk3,
+ // widgets get allocated the amount of size they ask for,
+ // leading to excessively long widgets.
+
+ if (min >= -SCALARPARAM_G_MAXDOUBLE) {
+ this->min = min;
+ } else {
+ this->min = -SCALARPARAM_G_MAXDOUBLE;
+ }
+ if (max <= SCALARPARAM_G_MAXDOUBLE) {
+ this->max = max;
+ } else {
+ this->max = SCALARPARAM_G_MAXDOUBLE;
+ }
param_set_value(value); // reset value to see whether it is in ranges
}