summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2014-09-29 23:42:55 +0000
committerJabiertxof <jtx@jtx.marker.es>2014-09-29 23:42:55 +0000
commitc257c4b640056415043e798da9039e0b5b4caaa9 (patch)
treeff2d38f204c3415c1f8ee49a3e4ba11ae3ad490e /src
parentRemove NRTypePosDef class and associated cruft. More direct CSS -> Pango tran... (diff)
downloadinkscape-c257c4b640056415043e798da9039e0b5b4caaa9.tar.gz
inkscape-c257c4b640056415043e798da9039e0b5b4caaa9.zip
add support for document-units in the helper path of bspline
(bzr r13341.1.234)
Diffstat (limited to 'src')
-rw-r--r--src/live_effects/lpe-bspline.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/live_effects/lpe-bspline.cpp b/src/live_effects/lpe-bspline.cpp
index 5dfad95dc..e8df6e464 100644
--- a/src/live_effects/lpe-bspline.cpp
+++ b/src/live_effects/lpe-bspline.cpp
@@ -39,9 +39,11 @@
#include "desktop-handles.h"
#include "verbs.h"
#include "sp-lpe-item.h"
+#include "sp-namedview.h"
#include "display/sp-canvas.h"
#include <typeinfo>
#include <vector>
+#include "util/units.h"
// For handling un-continuous paths:
#include "message-stack.h"
#include "inkscape.h"
@@ -117,8 +119,11 @@ void LPEBSpline::doEffect(SPCurve *curve)
curve->reset();
double radiusHelperNodes = 6.0;
- if (SP_ACTIVE_DESKTOP) {
+ SPDesktop *desktop = SP_ACTIVE_DESKTOP;
+ if (desktop){
radiusHelperNodes /= SP_ACTIVE_DESKTOP->current_zoom();
+ SPNamedView *nv = sp_desktop_namedview(desktop);
+ radiusHelperNodes = Inkscape::Util::Quantity::convert(radiusHelperNodes, "px", nv->doc_units->abbr);
}
for (Geom::PathVector::const_iterator path_it = original_pathv.begin();
@@ -264,7 +269,9 @@ LPEBSpline::drawHandle(Geom::Point p, double radiusHelperNodes)
{
char const * svgd = "M 1,0.5 A 0.5,0.5 0 0 1 0.5,1 0.5,0.5 0 0 1 0,0.5 0.5,0.5 0 0 1 0.5,0 0.5,0.5 0 0 1 1,0.5 Z";
Geom::PathVector pathv = sp_svg_read_pathv(svgd);
- pathv *= Geom::Affine(radiusHelperNodes,0,0,radiusHelperNodes,0,0);
+ Geom::Affine aff = Geom::Affine();
+ aff *= Geom::Scale(radiusHelperNodes);
+ pathv *= aff;
pathv += p - Geom::Point(0.5*radiusHelperNodes, 0.5*radiusHelperNodes);
hp.push_back(pathv[0]);
}