From 22db6068f172d060429f17a489bdce59e5836c69 Mon Sep 17 00:00:00 2001 From: Tomasz Boczkowski Date: Tue, 27 May 2014 21:57:33 +0200 Subject: SPPattern c++-sification: replacing pattern_ functions by methods pt1 (bzr r13341.6.19) --- src/knot-holder-entity.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/knot-holder-entity.cpp') diff --git a/src/knot-holder-entity.cpp b/src/knot-holder-entity.cpp index 6471124ec..7b79d86a8 100644 --- a/src/knot-holder-entity.cpp +++ b/src/knot-holder-entity.cpp @@ -187,7 +187,7 @@ PatternKnotHolderEntityAngle::knot_get() const { SPPattern const *pat = SP_PATTERN(SP_STYLE_FILL_SERVER(SP_OBJECT(item)->style)); - gdouble x = pattern_width(pat); + gdouble x = pat->get_width(); gdouble y = 0; Geom::Point delta = Geom::Point(x,y); Geom::Point scale = sp_pattern_extract_scale(pat); @@ -236,8 +236,8 @@ PatternKnotHolderEntityScale::knot_set(Geom::Point const &p, Geom::Point const & // Get the new scale from the position of the knotholder Geom::Point d = p_snapped - sp_pattern_extract_trans(pat); - gdouble pat_x = pattern_width(pat); - gdouble pat_y = pattern_height(pat); + gdouble pat_x = pat->get_width(); + gdouble pat_y = pat->get_height(); Geom::Scale scl(1); if ( state & GDK_CONTROL_MASK ) { // if ctrl is pressed: use 1:1 scaling @@ -263,8 +263,8 @@ PatternKnotHolderEntityScale::knot_get() const { SPPattern const *pat = SP_PATTERN(SP_STYLE_FILL_SERVER(SP_OBJECT(item)->style)); - gdouble x = pattern_width(pat); - gdouble y = pattern_height(pat); + gdouble x = pat->get_width(); + gdouble y = pat->get_height(); Geom::Point delta = Geom::Point(x,y); Geom::Affine a = pat->patternTransform; a[4] = 0; -- cgit v1.2.3 From 35100d54d146fd0fcf702abca02311b0ef95152f Mon Sep 17 00:00:00 2001 From: Tomasz Boczkowski Date: Thu, 29 May 2014 12:35:19 +0200 Subject: SPPattern c++-sification: class fields are private (bzr r13341.6.23) --- src/knot-holder-entity.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/knot-holder-entity.cpp') diff --git a/src/knot-holder-entity.cpp b/src/knot-holder-entity.cpp index 7b79d86a8..c3e48cf49 100644 --- a/src/knot-holder-entity.cpp +++ b/src/knot-holder-entity.cpp @@ -136,19 +136,19 @@ KnotHolderEntity::snap_knot_position_constrained(Geom::Point const &p, Inkscape: static gdouble sp_pattern_extract_theta(SPPattern const *pat) { - Geom::Affine transf = pat->patternTransform; + Geom::Affine transf = pat->get_transform(); return Geom::atan2(transf.xAxis()); } static Geom::Point sp_pattern_extract_scale(SPPattern const *pat) { - Geom::Affine transf = pat->patternTransform; + Geom::Affine transf = pat->get_transform(); return Geom::Point( transf.expansionX(), transf.expansionY() ); } static Geom::Point sp_pattern_extract_trans(SPPattern const *pat) { - return Geom::Point(pat->patternTransform[4], pat->patternTransform[5]); + return Geom::Point(pat->get_transform()[4], pat->get_transform()[5]); } void @@ -266,7 +266,7 @@ PatternKnotHolderEntityScale::knot_get() const gdouble x = pat->get_width(); gdouble y = pat->get_height(); Geom::Point delta = Geom::Point(x,y); - Geom::Affine a = pat->patternTransform; + Geom::Affine a = pat->get_transform(); a[4] = 0; a[5] = 0; delta = delta * a; -- cgit v1.2.3