summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Storz <eduard.braun2@gmx.de>2019-04-01 20:30:31 +0000
committerPatrick Storz <eduard.braun2@gmx.de>2019-04-02 20:10:02 +0000
commitaea9a4ef6bee5b259118ceed660349e30dfdc285 (patch)
treef5c94480142513ab675cd662e5df77b355dec381
parentReplace IS_FINITE with std::isfinite (exists since C++11) (diff)
downloadinkscape-aea9a4ef6bee5b259118ceed660349e30dfdc285.tar.gz
inkscape-aea9a4ef6bee5b259118ceed660349e30dfdc285.zip
Replace IS_NAN with std::isnan (exists since C++11)
-rw-r--r--src/desktop-style.cpp8
-rw-r--r--src/live_effects/lpe-knot.cpp2
-rw-r--r--src/object/sp-namedview.cpp6
-rw-r--r--src/ui/toolbar/star-toolbar.cpp2
-rw-r--r--src/ui/tools/calligraphic-tool.cpp4
5 files changed, 11 insertions, 11 deletions
diff --git a/src/desktop-style.cpp b/src/desktop-style.cpp
index d008b0b68..6c8095d53 100644
--- a/src/desktop-style.cpp
+++ b/src/desktop-style.cpp
@@ -458,7 +458,7 @@ stroke_average_width (const std::vector<SPItem*> &objects)
double width = item->style->stroke_width.computed * i2dt.descrim();
- if ( item->style->stroke.isNone() || IS_NAN(width)) {
+ if ( item->style->stroke.isNone() || std::isnan(width)) {
++n_notstroked; // do not count nonstroked objects
continue;
} else {
@@ -775,7 +775,7 @@ objects_query_strokewidth (const std::vector<SPItem*> &objects, SPStyle *style_r
Geom::Affine i2d = item->i2dt_affine();
double sw = style->stroke_width.computed * i2d.descrim();
- if (!IS_NAN(sw)) {
+ if (!std::isnan(sw)) {
if (prev_sw != -1 && fabs(sw - prev_sw) > 1e-3)
same_sw = false;
prev_sw = sw;
@@ -1068,7 +1068,7 @@ objects_query_fontnumbers (const std::vector<SPItem*> &objects, SPStyle *style_r
double doc_scale = Geom::Affine(item->i2dt_affine()).descrim();
double dummy = style->font_size.computed * doc_scale;
- if (!IS_NAN(dummy)) {
+ if (!std::isnan(dummy)) {
size += dummy; /// \todo FIXME: we assume non-% units here
} else {
no_size++;
@@ -1811,7 +1811,7 @@ objects_query_blur (const std::vector<SPItem*> &objects, SPStyle *style_res)
if (spblur) {
float num = spblur->stdDeviation.getNumber();
float dummy = num * i2d.descrim();
- if (!IS_NAN(dummy)) {
+ if (!std::isnan(dummy)) {
blur_sum += dummy;
if (blur_prev != -1 && fabs (num - blur_prev) > 1e-2) // rather low tolerance because difference in blur radii is much harder to notice than e.g. difference in sizes
same_blur = false;
diff --git a/src/live_effects/lpe-knot.cpp b/src/live_effects/lpe-knot.cpp
index d48dbd765..6ecf3ec7a 100644
--- a/src/live_effects/lpe-knot.cpp
+++ b/src/live_effects/lpe-knot.cpp
@@ -182,7 +182,7 @@ CrossingPoints::CrossingPoints(Geom::PathVector const &paths) : std::vector<Cros
}
for (auto & time : times){
//std::cout<<"intersection "<<i<<"["<<ii<<"]("<<times[k].first<<")= "<<j<<"["<<jj<<"]("<<times[k].second<<")\n";
- if ( !IS_NAN(time.first) && !IS_NAN(time.second) ){
+ if ( !std::isnan(time.first) && !std::isnan(time.second) ){
double zero = 1e-4;
if ( (i==j) && (fabs(time.first+ii - time.second-jj) <= zero) )
{ //this is just end=start of successive curves in a path.
diff --git a/src/object/sp-namedview.cpp b/src/object/sp-namedview.cpp
index 367df0876..b17af346c 100644
--- a/src/object/sp-namedview.cpp
+++ b/src/object/sp-namedview.cpp
@@ -838,9 +838,9 @@ void sp_namedview_window_from_document(SPDesktop *desktop)
void sp_namedview_zoom_and_view_from_document(SPDesktop *desktop)
{
SPNamedView *nv = desktop->namedview;
- if (nv->zoom != 0 && nv->zoom != HUGE_VAL && !IS_NAN(nv->zoom)
- && nv->cx != HUGE_VAL && !IS_NAN(nv->cx)
- && nv->cy != HUGE_VAL && !IS_NAN(nv->cy)) {
+ if (nv->zoom != 0 && nv->zoom != HUGE_VAL && !std::isnan(nv->zoom)
+ && nv->cx != HUGE_VAL && !std::isnan(nv->cx)
+ && nv->cy != HUGE_VAL && !std::isnan(nv->cy)) {
desktop->zoom_absolute_center_point( Geom::Point(nv->cx, nv->cy), nv->zoom );
} else if (desktop->getDocument()) { // document without saved zoom, zoom to its page
desktop->zoom_page();
diff --git a/src/ui/toolbar/star-toolbar.cpp b/src/ui/toolbar/star-toolbar.cpp
index 5135f06ee..d269fe431 100644
--- a/src/ui/toolbar/star-toolbar.cpp
+++ b/src/ui/toolbar/star-toolbar.cpp
@@ -295,7 +295,7 @@ void
StarToolbar::proportion_value_changed()
{
if (DocumentUndo::getUndoSensitive(_desktop->getDocument())) {
- if (!IS_NAN(_spoke_adj->get_value())) {
+ if (!std::isnan(_spoke_adj->get_value())) {
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
prefs->setDouble("/tools/shapes/star/proportion",
_spoke_adj->get_value());
diff --git a/src/ui/tools/calligraphic-tool.cpp b/src/ui/tools/calligraphic-tool.cpp
index ffe1ca46c..37a4a24f0 100644
--- a/src/ui/tools/calligraphic-tool.cpp
+++ b/src/ui/tools/calligraphic-tool.cpp
@@ -623,7 +623,7 @@ bool CalligraphicTool::root_handler(GdkEvent* event) {
// so _gradually_ let go attraction to prevent jerks
target = (this->hatch_spacing * speed + hatch_dist * (SPEED_NORMAL - speed))/SPEED_NORMAL;
}
- if (!IS_NAN(dot) && dot < -0.5) {// flip
+ if (!std::isnan(dot) && dot < -0.5) {// flip
target = -target;
}
@@ -708,7 +708,7 @@ bool CalligraphicTool::root_handler(GdkEvent* event) {
} else {
// Not drawing but spacing set: gray, center snapped, fixed radius
Geom::Point c = (nearest + this->hatch_spacing * hatch_unit_vector) * motion_to_curve.inverse();
- if (!IS_NAN(c[Geom::X]) && !IS_NAN(c[Geom::Y])) {
+ if (!std::isnan(c[Geom::X]) && !std::isnan(c[Geom::Y])) {
Geom::Affine const sm (Geom::Scale(this->hatch_spacing, this->hatch_spacing) * Geom::Translate(c));
sp_canvas_item_affine_absolute(this->hatch_area, sm);
sp_canvas_bpath_set_stroke(SP_CANVAS_BPATH(this->hatch_area), 0x7f7f7fff, 1.0, SP_STROKE_LINEJOIN_MITER, SP_STROKE_LINECAP_BUTT);