summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2014-10-30 19:11:17 +0000
committerJabiertxof <jtx@jtx.marker.es>2014-10-30 19:11:17 +0000
commit0976c402e0e09c4fe9d7d7d6990535e693b16a58 (patch)
tree08849d2b72f6e9d674af0fb39f59f7aaacdc4dd4 /src
parentStarting poinwise code for 0.92. Add base files (diff)
downloadinkscape-0976c402e0e09c4fe9d7d7d6990535e693b16a58.tar.gz
inkscape-0976c402e0e09c4fe9d7d7d6990535e693b16a58.zip
Fix a bug whith units pointed by suv
(bzr r13645.1.2)
Diffstat (limited to 'src')
-rw-r--r--src/live_effects/lpe-fillet-chamfer.cpp12
-rw-r--r--src/live_effects/parameter/filletchamferpointarray.cpp9
2 files changed, 9 insertions, 12 deletions
diff --git a/src/live_effects/lpe-fillet-chamfer.cpp b/src/live_effects/lpe-fillet-chamfer.cpp
index f15bf9215..8a8f68d80 100644
--- a/src/live_effects/lpe-fillet-chamfer.cpp
+++ b/src/live_effects/lpe-fillet-chamfer.cpp
@@ -34,6 +34,7 @@
#include "ui/tool/selectable-control-point.h"
#include "ui/tool/node.h"
#include "ui/tools/node-tool.h"
+#include <util/units.h>
// TODO due to internal breakage in glibmm headers, this must be last:
#include <glibmm/i18n.h>
@@ -172,9 +173,9 @@ void LPEFilletChamfer::toggleHide()
for (std::vector<Point>::const_iterator point_it = filletChamferData.begin();
point_it != filletChamferData.end(); ++point_it) {
if (hide_knots) {
- result.push_back(Point((*point_it)[X], abs((*point_it)[Y]) * -1));
+ result.push_back(Point((*point_it)[X], std::abs((*point_it)[Y]) * -1));
} else {
- result.push_back(Point((*point_it)[X], abs((*point_it)[Y])));
+ result.push_back(Point((*point_it)[X], std::abs((*point_it)[Y])));
}
}
fillet_chamfer_values.param_set_and_write_new_value(result);
@@ -211,7 +212,8 @@ void LPEFilletChamfer::updateFillet()
{
double power = 0;
if (!flexible) {
- power = Inkscape::Util::Quantity::convert(radius, unit.get_abbreviation(), "px") * -1;
+ Inkscape::Util::Unit const *doc_units = inkscape_active_desktop()->namedview->doc_units;
+ power = Inkscape::Util::Quantity::convert(radius, unit.get_abbreviation(), doc_units->abbr) * -1;
} else {
power = radius;
}
@@ -589,11 +591,11 @@ LPEFilletChamfer::doEffect_path(std::vector<Geom::Path> const &path_in)
}
int type = 0;
if(path_it->closed() && last){
- type = abs(filletChamferData[counter - counterCurves][Y]);
+ type = std::abs(filletChamferData[counter - counterCurves][Y]);
} else if (!path_it->closed() && last){
//0
} else {
- type = abs(filletChamferData[counter + 1][Y]);
+ type = std::abs(filletChamferData[counter + 1][Y]);
}
if (type == 3 || type == 4) {
if (type == 4) {
diff --git a/src/live_effects/parameter/filletchamferpointarray.cpp b/src/live_effects/parameter/filletchamferpointarray.cpp
index e2b1aba61..db24a9735 100644
--- a/src/live_effects/parameter/filletchamferpointarray.cpp
+++ b/src/live_effects/parameter/filletchamferpointarray.cpp
@@ -175,13 +175,8 @@ void FilletChamferPointArrayParam::recalculate_controlpoints_for_new_pwd2(
last_pathv[counterPaths][counter - offset].initialPoint(),
0.1))) {
if ( curve_it2 == curve_endit) {
- if (last_pathv[counterPaths].size() < pathv[counterPaths].size()) {
- offset = abs(last_pathv[counterPaths].size() -
- pathv[counterPaths].size());
- } else if (last_pathv[counterPaths].size() >
- pathv[counterPaths].size()) {
- offset = (abs(last_pathv[counterPaths].size() -
- pathv[counterPaths].size())) * -1;
+ if (last_pathv[counterPaths].size() != pathv[counterPaths].size()) {
+ offset = (last_pathv[counterPaths].size() - pathv[counterPaths].size()) * -1;
} else {
offset = 0;
}