summaryrefslogtreecommitdiffstats
path: root/src/sp-flowtext.cpp
diff options
context:
space:
mode:
authorbulia byak <buliabyak@gmail.com>2006-04-05 19:21:18 +0000
committerbuliabyak <buliabyak@users.sourceforge.net>2006-04-05 19:21:18 +0000
commit12595773adee9c6d8018aaf73502334ace98f61b (patch)
treef4adb72c27f4a900c7f5f376f8a28fe4fa8574a9 /src/sp-flowtext.cpp
parentFixing bug 1462517 (diff)
downloadinkscape-12595773adee9c6d8018aaf73502334ace98f61b.tar.gz
inkscape-12595773adee9c6d8018aaf73502334ace98f61b.zip
add stroke to bbox for flowtext too
(bzr r429)
Diffstat (limited to 'src/sp-flowtext.cpp')
-rw-r--r--src/sp-flowtext.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/sp-flowtext.cpp b/src/sp-flowtext.cpp
index 3f70f53ce..e078013aa 100644
--- a/src/sp-flowtext.cpp
+++ b/src/sp-flowtext.cpp
@@ -311,6 +311,21 @@ sp_flowtext_bbox(SPItem const *item, NRRect *bbox, NR::Matrix const &transform,
{
SPFlowtext *group = SP_FLOWTEXT(item);
group->layout.getBoundingBox(bbox, transform);
+
+ // Add stroke width
+ 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(bbox->x1 - bbox->x0) > -0.00001 && fabs(bbox->y1 - bbox->y0) > -0.00001 ) {
+ bbox->x0-=0.5*width;
+ bbox->x1+=0.5*width;
+ bbox->y0-=0.5*width;
+ bbox->y1+=0.5*width;
+ }
+ }
+ }
}
static void