summaryrefslogtreecommitdiffstats
path: root/src/helper/geom-pathvectorsatellites.cpp
diff options
context:
space:
mode:
authorJabiertxof <jtx@jtx>2017-01-22 17:53:31 +0000
committerJabiertxof <jtx@jtx>2017-01-22 17:53:31 +0000
commitd431044fc72f9b668dcfa5771f361f4d6088bdd7 (patch)
tree69862e58b8ed2adc86ab9220ed4a28b617a65c65 /src/helper/geom-pathvectorsatellites.cpp
parentUpdate to trunk (diff)
downloadinkscape-d431044fc72f9b668dcfa5771f361f4d6088bdd7.tar.gz
inkscape-d431044fc72f9b668dcfa5771f361f4d6088bdd7.zip
Update to new code in trunk
(bzr r13645.1.166)
Diffstat (limited to 'src/helper/geom-pathvectorsatellites.cpp')
-rw-r--r--src/helper/geom-pathvectorsatellites.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/helper/geom-pathvectorsatellites.cpp b/src/helper/geom-pathvectorsatellites.cpp
index eca866978..79055af8d 100644
--- a/src/helper/geom-pathvectorsatellites.cpp
+++ b/src/helper/geom-pathvectorsatellites.cpp
@@ -15,6 +15,8 @@
*/
#include <helper/geom-pathvectorsatellites.h>
+#include "util/units.h"
+
Geom::PathVector PathVectorSatellites::getPathVector() const
{
return _pathvector;
@@ -141,6 +143,27 @@ void PathVectorSatellites::updateAmount(double radius, bool apply_no_radius, boo
}
}
+void PathVectorSatellites::convertUnit(Glib::ustring in, Glib::ustring to, bool apply_no_radius, bool apply_with_radius)
+{
+ for (size_t i = 0; i < _satellites.size(); ++i) {
+ for (size_t j = 0; j < _satellites[i].size(); ++j) {
+ if (!_pathvector[i].closed() && j == 0) {
+ _satellites[i][j].amount = 0;
+ continue;
+ }
+ if (_pathvector[i].size() == j) {
+ continue;
+ }
+ if ((!apply_no_radius && _satellites[i][j].amount == 0) ||
+ (!apply_with_radius && _satellites[i][j].amount != 0))
+ {
+ continue;
+ }
+ _satellites[i][j].amount = Inkscape::Util::Quantity::convert(_satellites[i][j].amount, in.c_str(), to.c_str());
+ }
+ }
+}
+
void PathVectorSatellites::updateSatelliteType(SatelliteType satellitetype, bool apply_no_radius, bool apply_with_radius,
bool only_selected)
{