diff options
| author | Tavmjong Bah <tavmjong@free.fr> | 2019-09-24 12:28:31 +0000 |
|---|---|---|
| committer | Tavmjong Bah <tavmjong@free.fr> | 2019-09-24 12:28:31 +0000 |
| commit | d6b062f355dd643012f4870727813965cd142978 (patch) | |
| tree | a8dfcba976d53d19eef62d75d659eec2f93ba9d2 /src/knot-holder-entity.cpp | |
| parent | Remove use of sp_round. (diff) | |
| download | inkscape-d6b062f355dd643012f4870727813965cd142978.tar.gz inkscape-d6b062f355dd643012f4870727813965cd142978.zip | |
Remove remaining uses of sp_round.
Diffstat (limited to 'src/knot-holder-entity.cpp')
| -rw-r--r-- | src/knot-holder-entity.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/knot-holder-entity.cpp b/src/knot-holder-entity.cpp index 36d4053ef..19f3b8ef1 100644 --- a/src/knot-holder-entity.cpp +++ b/src/knot-holder-entity.cpp @@ -25,12 +25,12 @@ #include "snap.h" #include "style.h" -#include "include/macros.h" #include "object/sp-hatch.h" #include "object/sp-item.h" #include "object/sp-namedview.h" #include "object/sp-pattern.h" + int KnotHolderEntity::counter = 0; void KnotHolderEntity::create(SPDesktop *desktop, SPItem *item, KnotHolder *parent, Inkscape::ControlType type, @@ -221,7 +221,9 @@ PatternKnotHolderEntityAngle::knot_set(Geom::Point const &p, Geom::Point const & gdouble theta_old = atan2(knot_get() - transform_origin); if ( state & GDK_CONTROL_MASK ) { - theta = sp_round(theta, M_PI/snaps); + /* Snap theta */ + double snaps_radian = M_PI/snaps; + theta = std::round(theta/snaps_radian) * snaps_radian; } Geom::Affine rot = Geom::Translate(-transform_origin) @@ -329,7 +331,9 @@ void HatchKnotHolderEntityAngle::knot_set(Geom::Point const &p, Geom::Point cons gdouble theta_old = atan2(knot_get() - transform_origin); if (state & GDK_CONTROL_MASK) { - theta = sp_round(theta, M_PI / snaps); + /* Snap theta */ + double snaps_radian = M_PI/snaps; + theta = std::round(theta/snaps_radian) * snaps_radian; } Geom::Affine rot = |
