From c5695f6f88086f869eae0a775f6e868bd1d9c19d Mon Sep 17 00:00:00 2001 From: Thomas Geymayer Date: Thu, 5 Jul 2012 11:16:32 +0200 Subject: [PATCH] Fix setting global path options per path --- src/Canvas/elements/path.cxx | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/src/Canvas/elements/path.cxx b/src/Canvas/elements/path.cxx index 14a385ce5..95dff2052 100644 --- a/src/Canvas/elements/path.cxx +++ b/src/Canvas/elements/path.cxx @@ -79,8 +79,6 @@ namespace canvas { _stroke_width = width; _stroke_dash = dash; - - _attributes_dirty |= STROKE; } /** @@ -161,23 +159,14 @@ namespace canvas } // Initialize/Update the paint - if( _attributes_dirty & (STROKE_COLOR | STROKE) ) + if( _attributes_dirty & STROKE_COLOR ) { if( _paint == VG_INVALID_HANDLE ) _paint = vgCreatePaint(); - if( _attributes_dirty & STROKE_COLOR ) - vgSetParameterfv(_paint, VG_PAINT_COLOR, 4, _stroke_color); - if( _attributes_dirty & STROKE ) - { - vgSetf(VG_STROKE_LINE_WIDTH, _stroke_width); + vgSetParameterfv(_paint, VG_PAINT_COLOR, 4, _stroke_color); - vgSetfv( VG_STROKE_DASH_PATTERN, - _stroke_dash.size(), - _stroke_dash.empty() ? 0 : &_stroke_dash[0] ); - } - - _attributes_dirty &= ~(STROKE_COLOR | STROKE); + _attributes_dirty &= ~STROKE_COLOR; } // Initialize/update fill paint @@ -198,6 +187,11 @@ namespace canvas { mode |= VG_STROKE_PATH; vgSetPaint(_paint, VG_STROKE_PATH); + + vgSetf(VG_STROKE_LINE_WIDTH, _stroke_width); + vgSetfv( VG_STROKE_DASH_PATTERN, + _stroke_dash.size(), + _stroke_dash.empty() ? 0 : &_stroke_dash[0] ); } if( _fill ) { @@ -225,8 +219,7 @@ namespace canvas { PATH = 0x0001, STROKE_COLOR = PATH << 1, - STROKE = STROKE_COLOR << 1, - FILL_COLOR = STROKE << 1, + FILL_COLOR = STROKE_COLOR << 1, FILL = FILL_COLOR << 1 };