diff options
| author | Tavmjong Bah <tavmjong@free.fr> | 2014-11-26 17:23:19 +0000 |
|---|---|---|
| committer | tavmjong-free <tavmjong@free.fr> | 2014-11-26 17:23:19 +0000 |
| commit | 1eb57acf61991fc8f886d1acf2b432eb41a78565 (patch) | |
| tree | 6c4bd7b4366d53a07a6493494a6532e9ef72e851 /src/sp-guide.cpp | |
| parent | Dutch translation update (diff) | |
| download | inkscape-1eb57acf61991fc8f886d1acf2b432eb41a78565.tar.gz inkscape-1eb57acf61991fc8f886d1acf2b432eb41a78565.zip | |
Correct guide placement when created by dragging onto canvas or by creating guides around object/page.
(bzr r13771)
Diffstat (limited to 'src/sp-guide.cpp')
| -rw-r--r-- | src/sp-guide.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/sp-guide.cpp b/src/sp-guide.cpp index a92e6916b..d7d15bac7 100644 --- a/src/sp-guide.cpp +++ b/src/sp-guide.cpp @@ -192,7 +192,17 @@ SPGuide *SPGuide::createSPGuide(SPDocument *doc, Geom::Point const &pt1, Geom::P Geom::Point n = Geom::rot90(pt2 - pt1); - sp_repr_set_point(repr, "position", pt1); + // If root viewBox set, interpret guides in terms of viewBox (90/96) + double newx = pt1.x(); + double newy = pt1.y(); + + SPRoot *root = doc->getRoot(); + if( root->viewBox_set ) { + newx = newx * root->viewBox.width() / root->width.computed; + newy = newy * root->viewBox.height() / root->height.computed; + } + + sp_repr_set_point(repr, "position", Geom::Point( newx, newy )); sp_repr_set_point(repr, "orientation", n); SPNamedView *namedview = sp_document_namedview(doc, NULL); |
