diff options
| author | Alvin Penner <penner@vaxxine.com> | 2014-01-19 12:43:14 +0000 |
|---|---|---|
| committer | apenner <penner@vaxxine.com> | 2014-01-19 12:43:14 +0000 |
| commit | e5feb4b17ce16b17ee7ff19188072c25c736bf90 (patch) | |
| tree | db0954a71cdd16a47063b9bb1efd7015e8fc9338 /src/sp-item-transform.cpp | |
| parent | Try another fix for the undo when dragging bug #168695 (diff) | |
| download | inkscape-e5feb4b17ce16b17ee7ff19188072c25c736bf90.tar.gz inkscape-e5feb4b17ce16b17ee7ff19188072c25c736bf90.zip | |
fix scaling crash caused by negative stroke (Bug 1270464)
Fixed bugs:
- https://launchpad.net/bugs/1270464
(bzr r12956)
Diffstat (limited to 'src/sp-item-transform.cpp')
| -rw-r--r-- | src/sp-item-transform.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/sp-item-transform.cpp b/src/sp-item-transform.cpp index 9dbe412d7..854fb9cd7 100644 --- a/src/sp-item-transform.cpp +++ b/src/sp-item-transform.cpp @@ -110,6 +110,9 @@ Geom::Affine get_scale_transform_for_uniform_stroke(Geom::Rect const &bbox_visua // -> The width and height of the geometric bounding box will therefore be (w0 - 2*0.5*r0) and (h0 - 2*0.5*r0) // 4) If preserve transforms is true, then stroke_x != stroke_y, since these are the apparent stroke widths, after transforming + if ((stroke_x == Geom::infinity()) || (fabs(stroke_x) < 1e-6)) stroke_x = 0; + if ((stroke_y == Geom::infinity()) || (fabs(stroke_y) < 1e-6)) stroke_y = 0; + gdouble w0 = bbox_visual.width(); // will return a value >= 0, as required further down the road gdouble h0 = bbox_visual.height(); gdouble r0 = sqrt(stroke_x*stroke_y); // r0 is redundant, used only for those cases where stroke_x = stroke_y |
