From 046edcd4eb8bd48e1a10c14f0781f93977f78925 Mon Sep 17 00:00:00 2001 From: vanntile Date: Thu, 8 Aug 2019 09:51:12 +0300 Subject: HatchKnotHolderEntityScale & some fixes --- src/knot-holder-entity.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/knot-holder-entity.cpp') diff --git a/src/knot-holder-entity.cpp b/src/knot-holder-entity.cpp index afa51a9ad..36d4053ef 100644 --- a/src/knot-holder-entity.cpp +++ b/src/knot-holder-entity.cpp @@ -352,8 +352,17 @@ void HatchKnotHolderEntityScale::knot_set(Geom::Point const &p, Geom::Point cons Geom::Point d = p_snapped * transform_inverse; Geom::Point d_origin = origin * transform_inverse; Geom::Point origin_dt; + gdouble hatch_pitch = hatch->pitch(); + if (state & GDK_CONTROL_MASK) { + // if ctrl is pressed: use 1:1 scaling + d = d_origin * (d.length() / d_origin.length()); + } + + Geom::Affine scale = Geom::Translate(-origin_dt) * Geom::Scale(d.x() / hatch_pitch, d.y() / hatch_pitch) * + Geom::Translate(origin_dt) * transform; - // TODO ??? + item->adjust_hatch(scale, true, _fill ? TRANSFORM_FILL : TRANSFORM_STROKE); + item->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); } /* Filter manipulation */ -- cgit v1.2.3