summaryrefslogtreecommitdiffstats
path: root/src/ui
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2015-10-31 23:51:14 +0000
committerJabiertxof <jtx@jtx.marker.es>2015-10-31 23:51:14 +0000
commite5ef21e284cd3bd7da7f15fcee7f4d1999457b2e (patch)
tree5b37ed2db1e04f6610677f18ca9933d28ea68711 /src/ui
parentupdate to trunk (diff)
downloadinkscape-e5ef21e284cd3bd7da7f15fcee7f4d1999457b2e.tar.gz
inkscape-e5ef21e284cd3bd7da7f15fcee7f4d1999457b2e.zip
Order disposition of icons
Add inverse also to opacity (bzr r14422.1.37)
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/tools/spray-tool.cpp28
-rw-r--r--src/ui/tools/spray-tool.h2
2 files changed, 17 insertions, 13 deletions
diff --git a/src/ui/tools/spray-tool.cpp b/src/ui/tools/spray-tool.cpp
index d9a5de377..f7762ad8a 100644
--- a/src/ui/tools/spray-tool.cpp
+++ b/src/ui/tools/spray-tool.cpp
@@ -175,7 +175,7 @@ SprayTool::SprayTool()
, dilate_area(NULL)
, nooverlap(false)
, picker(false)
- , pickinversesize(false)
+ , pickinversevalue(false)
, pickfill(false)
, pickstroke(false)
, visible(false)
@@ -256,7 +256,7 @@ void SprayTool::setup() {
sp_event_context_read(this, "Scale");
sp_event_context_read(this, "offset");
sp_event_context_read(this, "picker");
- sp_event_context_read(this, "pickinversesize");
+ sp_event_context_read(this, "pickinversevalue");
sp_event_context_read(this, "pickfill");
sp_event_context_read(this, "pickstroke");
sp_event_context_read(this, "visible");
@@ -306,8 +306,8 @@ void SprayTool::set(const Inkscape::Preferences::Entry& val) {
this->offset = CLAMP(val.getDouble(), -1000.0, 1000.0);
} else if (path == "picker") {
this->picker = val.getBool();
- } else if (path == "pickinversesize") {
- this->pickinversesize = val.getBool();
+ } else if (path == "pickinversevalue") {
+ this->pickinversevalue = val.getBool();
} else if (path == "pickfill") {
this->pickfill = val.getBool();
} else if (path == "pickstroke") {
@@ -440,7 +440,7 @@ static bool fit_item(SPDesktop *desktop,
double &_scale,
double scale,
bool picker,
- bool pickinversesize,
+ bool pickinversevalue,
bool pickfill,
bool pickstroke,
bool visible,
@@ -625,7 +625,7 @@ static bool fit_item(SPDesktop *desktop,
rgba = SP_RGBA32_F_COMPOSE(r, g, b, a);
if (pick_to_size) {
if(!trace_scale){
- if(pickinversesize) {
+ if(pickinversevalue) {
_scale = 1.0 - val;
} else {
_scale = val;
@@ -642,7 +642,7 @@ static bool fit_item(SPDesktop *desktop,
_scale,
scale,
picker,
- pickinversesize,
+ pickinversevalue,
pickfill,
pickstroke,
visible,
@@ -656,7 +656,11 @@ static bool fit_item(SPDesktop *desktop,
}
if (pick_to_opacity) {
- opacity *= val;
+ if(pickinversevalue) {
+ opacity *= 1.0 - val;
+ } else {
+ opacity *= val;
+ }
std::stringstream opacity_str;
opacity_str.imbue(std::locale::classic());
opacity_str << opacity;
@@ -712,7 +716,7 @@ static bool sp_spray_recursive(SPDesktop *desktop,
gint _distrib,
bool nooverlap,
bool picker,
- bool pickinversesize,
+ bool pickinversevalue,
bool pickfill,
bool pickstroke,
bool visible,
@@ -757,7 +761,7 @@ static bool sp_spray_recursive(SPDesktop *desktop,
Geom::Point move = (Geom::Point(cos(tilt)*cos(dp)*dr/(1-ratio)+sin(tilt)*sin(dp)*dr/(1+ratio), -sin(tilt)*cos(dp)*dr/(1-ratio)+cos(tilt)*sin(dp)*dr/(1+ratio)))+(p-a->midpoint());
SPCSSAttr *css = sp_repr_css_attr_new();
if(nooverlap || picker || visible){
- if(!fit_item(desktop, item, a, move, center, angle, _scale, scale, picker, pickinversesize, pickfill, pickstroke, visible, nooverlap, offset, css, false)){
+ if(!fit_item(desktop, item, a, move, center, angle, _scale, scale, picker, pickinversevalue, pickfill, pickstroke, visible, nooverlap, offset, css, false)){
return false;
}
}
@@ -864,7 +868,7 @@ static bool sp_spray_recursive(SPDesktop *desktop,
Geom::Point move = (Geom::Point(cos(tilt)*cos(dp)*dr/(1-ratio)+sin(tilt)*sin(dp)*dr/(1+ratio), -sin(tilt)*cos(dp)*dr/(1-ratio)+cos(tilt)*sin(dp)*dr/(1+ratio)))+(p-a->midpoint());
SPCSSAttr *css = sp_repr_css_attr_new();
if(nooverlap || picker || visible){
- if(!fit_item(desktop, item, a, move, center, angle, _scale, scale, picker, pickinversesize, pickfill, pickstroke, visible, nooverlap, offset, css, false)){
+ if(!fit_item(desktop, item, a, move, center, angle, _scale, scale, picker, pickinversevalue, pickfill, pickstroke, visible, nooverlap, offset, css, false)){
return false;
}
}
@@ -942,7 +946,7 @@ static bool sp_spray_dilate(SprayTool *tc, Geom::Point /*event_p*/, Geom::Point
for(std::vector<SPItem*>::const_iterator i=items.begin();i!=items.end();i++){
SPItem *item = *i;
g_assert(item != NULL);
- if (sp_spray_recursive(desktop, selection, item, p, vector, tc->mode, radius, population, tc->scale, tc->scale_variation, reverse, move_mean, move_standard_deviation, tc->ratio, tc->tilt, tc->rotation_variation, tc->distrib, tc->nooverlap, tc->picker, tc->pickinversesize, tc->pickfill, tc->pickstroke, tc->visible, tc->offset, tc->usepressurescale, get_pressure(tc))) {
+ if (sp_spray_recursive(desktop, selection, item, p, vector, tc->mode, radius, population, tc->scale, tc->scale_variation, reverse, move_mean, move_standard_deviation, tc->ratio, tc->tilt, tc->rotation_variation, tc->distrib, tc->nooverlap, tc->picker, tc->pickinversevalue, tc->pickfill, tc->pickstroke, tc->visible, tc->offset, tc->usepressurescale, get_pressure(tc))) {
did = true;
}
}
diff --git a/src/ui/tools/spray-tool.h b/src/ui/tools/spray-tool.h
index 212948c77..ca0c20375 100644
--- a/src/ui/tools/spray-tool.h
+++ b/src/ui/tools/spray-tool.h
@@ -91,7 +91,7 @@ public:
SPCanvasItem *dilate_area;
bool nooverlap;
bool picker;
- bool pickinversesize;
+ bool pickinversevalue;
bool pickfill;
bool pickstroke;
bool visible;