diff --git a/src/meshlabplugins/edit_paint/edit_paint.cpp b/src/meshlabplugins/edit_paint/edit_paint.cpp index 8198771ae..13fbcac53 100644 --- a/src/meshlabplugins/edit_paint/edit_paint.cpp +++ b/src/meshlabplugins/edit_paint/edit_paint.cpp @@ -1342,7 +1342,7 @@ void drawPercentualPolyLine(GLArea * gla, QPoint &mid, MeshModel &m, GLfloat* pi da = da / 2.0; db = db / 2.0; dc = dc / 2.0; - if (fabsf(zz - pix_z) < 0.001) + if (std::abs(zz - pix_z) < 0.001) { proj_points[i] = QPointF(pix_x, inv_yy); break; diff --git a/src/meshlabplugins/edit_paint/edit_paint.h b/src/meshlabplugins/edit_paint/edit_paint.h index a9b6c9a1d..f097dba7b 100644 --- a/src/meshlabplugins/edit_paint/edit_paint.h +++ b/src/meshlabplugins/edit_paint/edit_paint.h @@ -332,16 +332,17 @@ inline void fastMultiply(float x, float y, float z, double matrix[], double *xr, */ inline int getNearest(QPointF center, QPointF *points, int num) { + using std::abs; int index = 0; - float dist = fabsf(center.x() - points[0].x())*fabsf(center.x() - points[0].x()) + fabsf(center.y() - points[0].y())*fabsf(center.y() - points[0].y()); + float dist = abs(center.x() - points[0].x())*abs(center.x() - points[0].x()) + abs(center.y() - points[0].y())*abs(center.y() - points[0].y()); float temp = 0; for (int i = 1; i < num; i++) { - temp = fabsf(center.x() - points[i].x())*fabsf(center.x() - points[i].x()) + - fabsf(center.y() - points[i].y())*fabsf(center.y() - points[i].y()); + temp = abs(center.x() - points[i].x())*abs(center.x() - points[i].x()) + + abs(center.y() - points[i].y())*abs(center.y() - points[i].y()); if (temp < dist) { index = i;