diff options
| author | Tavmjong Bah <tavmjong@free.fr> | 2019-09-24 11:17:51 +0000 |
|---|---|---|
| committer | Tavmjong Bah <tavmjong@free.fr> | 2019-09-24 11:17:51 +0000 |
| commit | 72aba43e422ebb0b122c91bae5c20c7b6549027e (patch) | |
| tree | dc98245ebf7242a71799c1edfa290fc9fe761a70 /src/ui/tools/star-tool.cpp | |
| parent | Precompile Python packages (diff) | |
| download | inkscape-72aba43e422ebb0b122c91bae5c20c7b6549027e.tar.gz inkscape-72aba43e422ebb0b122c91bae5c20c7b6549027e.zip | |
Remove use of sp_round.
Diffstat (limited to 'src/ui/tools/star-tool.cpp')
| -rw-r--r-- | src/ui/tools/star-tool.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/ui/tools/star-tool.cpp b/src/ui/tools/star-tool.cpp index a6a143ec0..8b916ae36 100644 --- a/src/ui/tools/star-tool.cpp +++ b/src/ui/tools/star-tool.cpp @@ -26,7 +26,6 @@ #include "desktop.h" #include "document-undo.h" #include "document.h" -#include "include/macros.h" #include "message-context.h" #include "selection.h" #include "verbs.h" @@ -34,6 +33,8 @@ #include "display/sp-canvas.h" #include "display/sp-canvas-item.h" +#include "include/macros.h" + #include "object/sp-namedview.h" #include "object/sp-star.h" @@ -381,7 +382,8 @@ void StarTool::drag(Geom::Point p, guint state) if (state & GDK_CONTROL_MASK) { /* Snap angle */ - arg1 = sp_round(arg1, M_PI / snaps); + double snaps_radian = M_PI/snaps; + arg1 = std::round(arg1/snaps_radian) * snaps_radian; } sp_star_position_set(this->star, this->magnitude, p0, r1, r1 * this->proportion, @@ -392,9 +394,9 @@ void StarTool::drag(Geom::Point p, guint state) Glib::ustring rads = q.string(desktop->namedview->display_units); this->message_context->setF(Inkscape::IMMEDIATE_MESSAGE, ( this->isflatsided? - _("<b>Polygon</b>: radius %s, angle %5g°; with <b>Ctrl</b> to snap angle") - : _("<b>Star</b>: radius %s, angle %5g°; with <b>Ctrl</b> to snap angle") ), - rads.c_str(), sp_round((arg1) * 180 / M_PI, 0.0001)); + _("<b>Polygon</b>: radius %s, angle %.2f°; with <b>Ctrl</b> to snap angle") : + _("<b>Star</b>: radius %s, angle %.2f°; with <b>Ctrl</b> to snap angle") ), + rads.c_str(), arg1 * 180 / M_PI); } void StarTool::finishItem() { |
