summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a6c56b5)
raw | patch | inline | side by side (parent: a6c56b5)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Fri, 6 Apr 2007 06:14:04 +0000 (06:14 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Fri, 6 Apr 2007 06:14:04 +0000 (06:14 +0000) |
src/sp-item.cpp | patch | blob | history | |
src/sp-shape.cpp | patch | blob | history |
diff --git a/src/sp-item.cpp b/src/sp-item.cpp
index 28d8ed6bcef6f28a667cc170dd9964dd6910c243..ab1f6e24205d9a26ad8df51b0718c2f8950b1247 100644 (file)
--- a/src/sp-item.cpp
+++ b/src/sp-item.cpp
@@ -704,8 +704,8 @@ sp_item_invoke_bbox_full(SPItem const *item, NRRect *bbox, NR::Matrix const &tra
((SPItemClass *) G_OBJECT_GET_CLASS(item))->bbox(item, &this_bbox, transform, flags);
}
- // crop the bbox by clip path, if any
- if (item->clip_ref->getObject()) {
+ // unless this is geometric bbox, crop the bbox by clip path, if any
+ if ((SPItem::BBoxType) flags != SPItem::GEOMETRIC_BBOX && item->clip_ref->getObject()) {
NRRect b;
sp_clippath_get_bbox(SP_CLIPPATH(item->clip_ref->getObject()), &b, transform, flags);
nr_rect_d_intersect (&this_bbox, &this_bbox, &b);
diff --git a/src/sp-shape.cpp b/src/sp-shape.cpp
index a37da6840540274e02e0cb98772ee84d3fa80ab9..55dfe65493c8e4fbd50d0f152ed3b40f7bbf723c 100644 (file)
--- a/src/sp-shape.cpp
+++ b/src/sp-shape.cpp
@@ -618,43 +618,45 @@ static void sp_shape_bbox(SPItem const *item, NRRect *bbox, NR::Matrix const &tr
nr_path_matrix_bbox_union(&bp, transform, &cbbox);
- SPStyle* style=SP_OBJECT_STYLE (item);
- if (style->stroke.type != SP_PAINT_TYPE_NONE) {
- double const scale = expansion(transform);
- if ( fabs(style->stroke_width.computed * scale) > 0.01 ) { // sinon c'est 0=oon veut pas de bord
- double const width = MAX(0.125, style->stroke_width.computed * scale);
- if ( fabs(cbbox.x1-cbbox.x0) > -0.00001 && fabs(cbbox.y1-cbbox.y0) > -0.00001 ) {
- cbbox.x0-=0.5*width;
- cbbox.x1+=0.5*width;
- cbbox.y0-=0.5*width;
- cbbox.y1+=0.5*width;
+ if ((SPItem::BBoxType) flags != SPItem::GEOMETRIC_BBOX) {
+ SPStyle* style=SP_OBJECT_STYLE (item);
+ if (style->stroke.type != SP_PAINT_TYPE_NONE) {
+ double const scale = expansion(transform);
+ if ( fabs(style->stroke_width.computed * scale) > 0.01 ) { // sinon c'est 0=oon veut pas de bord
+ double const width = MAX(0.125, style->stroke_width.computed * scale);
+ if ( fabs(cbbox.x1-cbbox.x0) > -0.00001 && fabs(cbbox.y1-cbbox.y0) > -0.00001 ) {
+ cbbox.x0-=0.5*width;
+ cbbox.x1+=0.5*width;
+ cbbox.y0-=0.5*width;
+ cbbox.y1+=0.5*width;
+ }
}
}
- }
- // Union with bboxes of the markers, if any
- if (sp_shape_has_markers (shape)) {
- for (NArtBpath* bp = SP_CURVE_BPATH(shape->curve); bp->code != NR_END; bp++) {
- for (int m = SP_MARKER_LOC_START; m < SP_MARKER_LOC_QTY; m++) {
- if (sp_shape_marker_required (shape, m, bp)) {
+ // Union with bboxes of the markers, if any
+ if (sp_shape_has_markers (shape)) {
+ for (NArtBpath* bp = SP_CURVE_BPATH(shape->curve); bp->code != NR_END; bp++) {
+ for (int m = SP_MARKER_LOC_START; m < SP_MARKER_LOC_QTY; m++) {
+ if (sp_shape_marker_required (shape, m, bp)) {
- SPMarker* marker = SP_MARKER (shape->marker[m]);
- SPItem* marker_item = sp_item_first_item_child (SP_OBJECT (shape->marker[m]));
+ SPMarker* marker = SP_MARKER (shape->marker[m]);
+ SPItem* marker_item = sp_item_first_item_child (SP_OBJECT (shape->marker[m]));
- NR::Matrix tr(sp_shape_marker_get_transform(shape, bp));
+ NR::Matrix tr(sp_shape_marker_get_transform(shape, bp));
- if (marker->markerUnits == SP_MARKER_UNITS_STROKEWIDTH) {
- tr = NR::scale(style->stroke_width.computed) * tr;
- }
+ if (marker->markerUnits == SP_MARKER_UNITS_STROKEWIDTH) {
+ tr = NR::scale(style->stroke_width.computed) * tr;
+ }
- // total marker transform
- tr = marker_item->transform * marker->c2p * tr * transform;
+ // total marker transform
+ tr = marker_item->transform * marker->c2p * tr * transform;
- // get bbox of the marker with that transform
- NRRect marker_bbox;
- sp_item_invoke_bbox (marker_item, &marker_bbox, tr, true);
- // union it with the shape bbox
- nr_rect_d_union (&cbbox, &cbbox, &marker_bbox);
+ // get bbox of the marker with that transform
+ NRRect marker_bbox;
+ sp_item_invoke_bbox (marker_item, &marker_bbox, tr, true);
+ // union it with the shape bbox
+ nr_rect_d_union (&cbbox, &cbbox, &marker_bbox);
+ }
}
}
}