From 94b59ee279e0940f22f1b99c77ea99559f56603f Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Sun, 29 Aug 2010 18:33:10 +0200 Subject: fix bug where bbox is calculated wrong for paths with markers when the path has a transform applied. the transform was applied twice (sp_shape_marker_get_transform_at_start already takes care of rotation and translation, and scale is taken care of by item_outline call within item_outline_add_marker) Fixed bugs: - https://launchpad.net/bugs/624775 (bzr r9731) --- src/splivarot.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/splivarot.cpp') diff --git a/src/splivarot.cpp b/src/splivarot.cpp index db9f72975..2b7da7f8a 100644 --- a/src/splivarot.cpp +++ b/src/splivarot.cpp @@ -626,8 +626,7 @@ void sp_selected_path_outline_add_marker( SPObject *marker_object, Geom::Matrix static void item_outline_add_marker( SPObject const *marker_object, Geom::Matrix marker_transform, - Geom::Scale stroke_scale, Geom::Matrix transform, - Geom::PathVector* pathv_in ) + Geom::Scale stroke_scale, Geom::PathVector* pathv_in ) { SPMarker* marker = SP_MARKER (marker_object); SPItem* marker_item = sp_item_first_item_child(SP_OBJECT(marker_object)); @@ -637,7 +636,7 @@ void item_outline_add_marker( SPObject const *marker_object, Geom::Matrix marker tr = stroke_scale * tr; } // total marker transform - tr = marker_item->transform * marker->c2p * tr * transform; + tr = marker_item->transform * marker->c2p * tr; Geom::PathVector* marker_pathv = item_outline(marker_item); @@ -792,7 +791,7 @@ Geom::PathVector* item_outline(SPItem const *item) if ( SPObject *marker_obj = shape->marker[i] ) { Geom::Matrix const m (sp_shape_marker_get_transform_at_start(pathv.front().front())); item_outline_add_marker( marker_obj, m, - Geom::Scale(i_style->stroke_width.computed), transform, + Geom::Scale(i_style->stroke_width.computed), ret_pathv ); } } @@ -807,7 +806,7 @@ Geom::PathVector* item_outline(SPItem const *item) { Geom::Matrix const m (sp_shape_marker_get_transform_at_start(path_it->front())); item_outline_add_marker( midmarker_obj, m, - Geom::Scale(i_style->stroke_width.computed), transform, + Geom::Scale(i_style->stroke_width.computed), ret_pathv ); } // MID position @@ -822,7 +821,7 @@ Geom::PathVector* item_outline(SPItem const *item) */ Geom::Matrix const m (sp_shape_marker_get_transform(*curve_it1, *curve_it2)); item_outline_add_marker( midmarker_obj, m, - Geom::Scale(i_style->stroke_width.computed), transform, + Geom::Scale(i_style->stroke_width.computed), ret_pathv); ++curve_it1; @@ -834,7 +833,7 @@ Geom::PathVector* item_outline(SPItem const *item) Geom::Curve const &lastcurve = path_it->back_default(); Geom::Matrix const m = sp_shape_marker_get_transform_at_end(lastcurve); item_outline_add_marker( midmarker_obj, m, - Geom::Scale(i_style->stroke_width.computed), transform, + Geom::Scale(i_style->stroke_width.computed), ret_pathv ); } } @@ -853,7 +852,7 @@ Geom::PathVector* item_outline(SPItem const *item) Geom::Matrix const m = sp_shape_marker_get_transform_at_end(lastcurve); item_outline_add_marker( marker_obj, m, - Geom::Scale(i_style->stroke_width.computed), transform, + Geom::Scale(i_style->stroke_width.computed), ret_pathv ); } } -- cgit v1.2.3 From 685ca91c9f6142ddee5b5da0c0ab77cf64459c7f Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Sat, 23 Oct 2010 22:24:27 +0200 Subject: Don't try displaying markers for completely empty paths, fixes crash. Fixed bugs: - https://launchpad.net/bugs/511577 (bzr r9843) --- src/splivarot.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/splivarot.cpp') diff --git a/src/splivarot.cpp b/src/splivarot.cpp index 2b7da7f8a..e273ca82f 100644 --- a/src/splivarot.cpp +++ b/src/splivarot.cpp @@ -674,6 +674,10 @@ Geom::PathVector* item_outline(SPItem const *item) return ret_pathv; } + if (curve->get_pathvector().empty()) { + return ret_pathv; + } + // remember old stroke style, to be set on fill SPStyle *i_style = SP_OBJECT_STYLE(item); @@ -900,6 +904,10 @@ sp_selected_path_outline(SPDesktop *desktop) continue; } + if (curve->get_pathvector().empty()) { + continue; + } + // pas de stroke pas de chocolat if (!SP_OBJECT_STYLE(item) || SP_OBJECT_STYLE(item)->stroke.noneSet) { curve->unref(); -- cgit v1.2.3 From 144819c918dc761641c3cb5a490205fb73194ee3 Mon Sep 17 00:00:00 2001 From: Chris Morgan Date: Wed, 17 Nov 2010 13:12:56 +1100 Subject: Super duper mega (fun!) commit: replaced encoding=utf-8 with fileencoding=utf-8 in all 1074 Vim modelines. The reason for this is that (a) setting the encoding isn't nice, and (b) Vim 7.3 (with modeline enabled) disallows it and pops up an error whenever you open any file with it ("invalid modeline"). Also corrected five deviant modestrings: * src/ui/widget/dock.cpp and src/ui/widget/dock.h: missing colon at the end * src/ui/dialog/tile.cpp: removed gratuitous second colon at the end * src/helper/units-test.h: removed gratuitous space before a colon * share/extensions/export_gimp_palette.py: missing textwidth=99 That's my geekiest commit yet. (bzr r9900) --- src/splivarot.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/splivarot.cpp') diff --git a/src/splivarot.cpp b/src/splivarot.cpp index e273ca82f..e7787813d 100644 --- a/src/splivarot.cpp +++ b/src/splivarot.cpp @@ -2155,4 +2155,4 @@ Geom::Point get_point_on_Path(Path *path, int piece, double t) fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : -- cgit v1.2.3