summaryrefslogtreecommitdiffstats
path: root/src/seltrans.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/seltrans.h')
-rw-r--r--src/seltrans.h31
1 files changed, 25 insertions, 6 deletions
diff --git a/src/seltrans.h b/src/seltrans.h
index fec8ab017..00d7fb1c4 100644
--- a/src/seltrans.h
+++ b/src/seltrans.h
@@ -4,9 +4,10 @@
/*
* Helper object for transforming selected items
*
- * Author:
+ * Authors:
* Lauris Kaplinski <lauris@kaplinski.com>
* Carl Hetherington <inkscape@carlh.net>
+ * Diederik van Lierop <mail@diedenrezi.nl>
*
* Copyright (C) 2006 Johan Engelen <johan@shouraizou.nl>
* Copyright (C) 1999-2002 Lauris Kaplinski
@@ -32,6 +33,8 @@ class SPSelTransHandle;
namespace Inkscape
{
+NR::scale calcScaleFactors(NR::Point const &initial_point, NR::Point const &new_point, NR::Point const &origin, bool const skew = false);
+
namespace XML
{
class Node;
@@ -96,10 +99,13 @@ private:
void _selModified(Inkscape::Selection *selection, guint flags);
void _showHandles(SPKnot *knot[], SPSelTransHandle const handle[], gint num,
gchar const *even_tip, gchar const *odd_tip);
+ NR::Point _getGeomHandlePos(NR::Point const &visual_handle_pos);
+ NR::Point _calcAbsAffineDefault(NR::scale const default_scale);
+ NR::Point _calcAbsAffineGeom(NR::scale const geom_scale);
enum State {
- STATE_SCALE,
- STATE_ROTATE
+ STATE_SCALE, //scale or stretch
+ STATE_ROTATE //rotate or skew
};
SPDesktop *_desktop;
@@ -125,15 +131,27 @@ private:
NR::Maybe<NR::Rect> _bbox;
NR::Maybe<NR::Rect> _approximate_bbox;
+ NR::Maybe<NR::Rect> _geometric_bbox;
gdouble _strokewidth;
- NR::Matrix _current;
- NR::Point _opposite; ///< opposite point to where a scale is taking place
-
+
+ NR::Matrix _current_relative_affine;
+ NR::Matrix _absolute_affine;
+ NR::Matrix _relative_affine;
+ /* According to Merriam - Webster's online dictionary
+ * Affine: a transformation (as a translation, a rotation, or a uniform stretching) that carries straight
+ * lines into straight lines and parallel lines into parallel lines but may alter distance between points
+ * and angles between lines <affine geometry>
+ */
+
+ NR::Point _opposite; ///< opposite point to where a scale is taking place
NR::Point _opposite_for_specpoints;
NR::Point _opposite_for_bboxpoints;
NR::Point _origin_for_specpoints;
NR::Point _origin_for_bboxpoints;
+ gdouble _handle_x;
+ gdouble _handle_y;
+
NR::Maybe<NR::Point> _center;
bool _center_is_set; ///< we've already set _center, no need to reread it from items
@@ -149,6 +167,7 @@ private:
NR::Point _origin; ///< position of origin for transforms
NR::Point _point; ///< original position of the knot being used for the current transform
+ NR::Point _point_geom; ///< original position of the knot being used for the current transform
Inkscape::MessageContext _message_context;
sigc::connection _sel_changed_connection;
sigc::connection _sel_modified_connection;