summaryrefslogtreecommitdiffstats
path: root/src/desktop-style.cpp
diff options
context:
space:
mode:
authorbulia byak <buliabyak@gmail.com>2006-05-17 06:57:31 +0000
committerbuliabyak <buliabyak@users.sourceforge.net>2006-05-17 06:57:31 +0000
commit89ebf1ef9be50eea5e790298bca211fffbad12a8 (patch)
tree03f50f02f8b98dfdb04d296dcac310fa79f2d649 /src/desktop-style.cpp
parentFlipped top/bottom in layers UI to reflect visible stacking. (diff)
downloadinkscape-89ebf1ef9be50eea5e790298bca211fffbad12a8.tar.gz
inkscape-89ebf1ef9be50eea5e790298bca211fffbad12a8.zip
do calligraphic draw opacity correctly
(bzr r863)
Diffstat (limited to 'src/desktop-style.cpp')
-rw-r--r--src/desktop-style.cpp23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/desktop-style.cpp b/src/desktop-style.cpp
index afb3a1045..cf8f67442 100644
--- a/src/desktop-style.cpp
+++ b/src/desktop-style.cpp
@@ -222,12 +222,12 @@ sp_desktop_get_color(SPDesktop *desktop, bool is_fill)
}
double
-sp_desktop_get_opacity_tool(SPDesktop *desktop, char const *tool, bool op)
+sp_desktop_get_opacity_tool(SPDesktop *desktop, char const *tool)
{
SPCSSAttr *css = NULL;
gfloat value = 1.0; // default if nothing else found
if (prefs_get_double_attribute(tool, "usecurrent", 0) != 0) {
- css = sp_desktop_get_style(desktop, op);
+ css = sp_desktop_get_style(desktop, true);
} else {
Inkscape::XML::Node *tool_repr = inkscape_get_repr(INKSCAPE, tool);
css = sp_repr_css_attr_inherited(tool_repr, "style");
@@ -240,6 +240,11 @@ sp_desktop_get_opacity_tool(SPDesktop *desktop, char const *tool, bool op)
value = 1.0; // things failed. set back to the default
}
}
+
+ if (css) {
+ sp_repr_css_attr_unref(css);
+ }
+
return value;
}
guint32
@@ -247,10 +252,8 @@ sp_desktop_get_color_tool(SPDesktop *desktop, char const *tool, bool is_fill)
{
SPCSSAttr *css = NULL;
guint32 r = 0; // if there's no color, return black
- bool op = true;
- double opacity = sp_desktop_get_opacity_tool(SP_ACTIVE_DESKTOP, "tools.calligraphic", op);
if (prefs_get_int_attribute(tool, "usecurrent", 0) != 0) {
- css = sp_desktop_get_style(desktop, is_fill);
+ css = sp_desktop_get_style(desktop, true);
} else {
Inkscape::XML::Node *tool_repr = inkscape_get_repr(INKSCAPE, tool);
css = sp_repr_css_attr_inherited(tool_repr, "style");
@@ -264,7 +267,12 @@ sp_desktop_get_color_tool(SPDesktop *desktop, char const *tool, bool is_fill)
r = sp_svg_read_color(property, r);
}
}
- return r | SP_COLOR_F_TO_U( opacity ); // return RGBA color
+
+ if (css) {
+ sp_repr_css_attr_unref(css);
+ }
+
+ return r | 0xff;
}
/**
* Apply the desktop's current style or the tool style to repr.
@@ -283,7 +291,8 @@ sp_desktop_apply_style_tool(SPDesktop *desktop, Inkscape::XML::Node *repr, char
sp_repr_css_attr_unref(css);
}
}
- if (css_current) {sp_repr_css_attr_unref(css_current);
+ if (css_current) {
+ sp_repr_css_attr_unref(css_current);
}
}