summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbulia byak <buliabyak@gmail.com>2006-11-04 21:59:07 +0000
committerbuliabyak <buliabyak@users.sourceforge.net>2006-11-04 21:59:07 +0000
commit315f2fbacc1fe838f5ab2bd1863ed0392813b749 (patch)
treeae989768a487e1031705be0c0287407c9ca384d6 /src
parentUpdated the spanish translation and fixed the dz translation... (diff)
downloadinkscape-315f2fbacc1fe838f5ab2bd1863ed0392813b749.tar.gz
inkscape-315f2fbacc1fe838f5ab2bd1863ed0392813b749.zip
fix bug: stroke width was not changed when switching to outline and back
(bzr r1894)
Diffstat (limited to 'src')
-rw-r--r--src/display/nr-arena-shape.cpp14
-rw-r--r--src/display/nr-arena-shape.h2
2 files changed, 14 insertions, 2 deletions
diff --git a/src/display/nr-arena-shape.cpp b/src/display/nr-arena-shape.cpp
index 357245667..8c4b42577 100644
--- a/src/display/nr-arena-shape.cpp
+++ b/src/display/nr-arena-shape.cpp
@@ -494,9 +494,13 @@ nr_arena_shape_update_stroke(NRArenaShape *shape,NRGC* gc, NRRectL *area)
((shape->_stroke.paint.type() != NRArenaShape::Paint::NONE) &&
( fabs(shape->_stroke.width * scale) > 0.01 ))) { // sinon c'est 0=oon veut pas de bord
- float width = MAX(0.125, shape->_stroke.width * scale);
- if (outline)
+ float style_width = MAX(0.125, shape->_stroke.width * scale);
+ float width;
+ if (outline) {
width = 0.5; // 1 pixel wide, independent of zoom
+ } else {
+ width = style_width;
+ }
NR::Matrix cached_to_new = NR::identity();
@@ -510,6 +514,10 @@ nr_arena_shape_update_stroke(NRArenaShape *shape,NRGC* gc, NRRectL *area)
}
if (0 != isometry && !is_inner_area(shape->cached_sarea, *area))
isometry = 0;
+ if (0 != isometry && width != shape->cached_width) {
+ // if this happens without setting style, we have just switched to outline or back
+ isometry = 0;
+ }
}
if ( isometry == 0 ) {
@@ -582,6 +590,8 @@ nr_arena_shape_update_stroke(NRArenaShape *shape,NRGC* gc, NRRectL *area)
shape->cached_stroke->ConvertToShape(theShape, fill_nonZero);
}
+ shape->cached_width = width;
+
shape->cached_sctm=gc->transform;
shape->cached_sarea = *area;
delete thePath;
diff --git a/src/display/nr-arena-shape.h b/src/display/nr-arena-shape.h
index cd72013f6..782ae127a 100644
--- a/src/display/nr-arena-shape.h
+++ b/src/display/nr-arena-shape.h
@@ -122,6 +122,8 @@ struct NRArenaShape : public NRArenaItem {
// the 2 cached polygons, for rasterizations uses
Shape *fill_shp;
Shape *stroke_shp;
+ // the stroke width of stroke_shp, to detect when it changes (on normal/outline switching) and rebuild
+ float cached_width;
// delayed_shp=true means the *_shp polygons are not computed yet
// they'll be computed on demand in *_render(), *_pick() or *_clip()
// the goal is to not uncross polygons that are outside the viewing region