diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2014-08-23 13:04:31 +0000 |
|---|---|---|
| committer | Johan B. C. Engelen <j.b.c.engelen@alumnus.utwente.nl> | 2014-08-23 13:04:31 +0000 |
| commit | 3c8060ba7e44eea05cb24db78a71e27e3742da03 (patch) | |
| tree | 146a2731a32de057a16be2a684b4015cbdc8f397 /src/seltrans.cpp | |
| parent | fix Windows 64-bit build (diff) | |
| parent | Fix skewing bug that could lead to infinite transforms (diff) | |
| download | inkscape-3c8060ba7e44eea05cb24db78a71e27e3742da03.tar.gz inkscape-3c8060ba7e44eea05cb24db78a71e27e3742da03.zip | |
update to trunk lp:inkscape 13530 (fixes Windows build)
(bzr r13341.1.155)
Diffstat (limited to 'src/seltrans.cpp')
| -rw-r--r-- | src/seltrans.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/seltrans.cpp b/src/seltrans.cpp index 6b8cd19bb..e15249f94 100644 --- a/src/seltrans.cpp +++ b/src/seltrans.cpp @@ -9,7 +9,7 @@ * Abhishek Sharma * * Copyright (C) 1999-2002 Lauris Kaplinski - * Copyright (C) 1999-2008 Authors + * Copyright (C) 1999-2014 Authors * * Released under GNU GPL, read the file 'COPYING' for more information */ @@ -1109,10 +1109,17 @@ gboolean Inkscape::SelTrans::skewRequest(SPSelTransHandle const &handle, Geom::P break; } + // _point and _origin are noisy, ranging from 1 to 1e-9 or even smaller; this is due to the + // limited SVG output precision, which can be arbitrarily set in the preferences Geom::Point const initial_delta = _point - _origin; - if (fabs(initial_delta[dim_a]) < 1e-15) { - return false; + // The handle and the origin shouldn't be too close to each other; let's check for that! + // Due to the limited resolution though (see above), we'd better use a relative error here + if (_bbox) { + Geom::Coord d = (*_bbox).dimensions()[dim_a]; + if (fabs(initial_delta[dim_a]/d) < 1e-4) { + return false; + } } // Calculate the scale factors, which can be either visual or geometric |
