From 89ebf1ef9be50eea5e790298bca211fffbad12a8 Mon Sep 17 00:00:00 2001 From: bulia byak Date: Wed, 17 May 2006 06:57:31 +0000 Subject: do calligraphic draw opacity correctly (bzr r863) --- src/dyna-draw-context.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/dyna-draw-context.cpp') diff --git a/src/dyna-draw-context.cpp b/src/dyna-draw-context.cpp index ebabeef31..ff570fb62 100644 --- a/src/dyna-draw-context.cpp +++ b/src/dyna-draw-context.cpp @@ -46,6 +46,7 @@ #include "context-fns.h" #include "sp-item.h" #include "inkscape.h" +#include "color.h" #define DDC_RED_RGBA 0xff0000ff @@ -806,9 +807,10 @@ fit_and_split_calligraphics(SPDynaDrawContext *dc, gboolean release) SPCurve *curve = sp_curve_copy(dc->currentcurve); sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH (cbp), curve); sp_curve_unref(curve); - guint32 fillColor = sp_desktop_get_color_tool(SP_ACTIVE_DESKTOP, "tools.calligraphic", true); - sp_canvas_bpath_set_fill(SP_CANVAS_BPATH(cbp), fillColor , SP_WIND_RULE_EVENODD); + guint32 fillColor = sp_desktop_get_color_tool (SP_ACTIVE_DESKTOP, "tools.calligraphic", true); + double opacity = sp_desktop_get_opacity_tool (SP_ACTIVE_DESKTOP, "tools.calligraphic"); + sp_canvas_bpath_set_fill(SP_CANVAS_BPATH(cbp), ((fillColor & 0xffffff00) | SP_COLOR_F_TO_U(opacity)), SP_WIND_RULE_EVENODD); sp_canvas_bpath_set_stroke(SP_CANVAS_BPATH(cbp), 0x00000000, 1.0, SP_STROKE_LINEJOIN_MITER, SP_STROKE_LINECAP_BUTT); /* fixme: Cannot we cascade it to root more clearly? */ g_signal_connect(G_OBJECT(cbp), "event", G_CALLBACK(sp_desktop_root_handler), SP_EVENT_CONTEXT(dc)->desktop); -- cgit v1.2.3