From a18ef5710791412d906f09ed04f89d98d4952b9e Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Wed, 13 Apr 2016 17:27:54 +0200 Subject: using cpp limits values (bzr r14836) --- src/libnrtype/Layout-TNG-Compute.cpp | 5 +++-- src/libnrtype/Layout-TNG-Scanline-Makers.cpp | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/libnrtype/Layout-TNG-Compute.cpp b/src/libnrtype/Layout-TNG-Compute.cpp index e862f0657..337d2a656 100644 --- a/src/libnrtype/Layout-TNG-Compute.cpp +++ b/src/libnrtype/Layout-TNG-Compute.cpp @@ -14,6 +14,7 @@ #include "svg/svg-length.h" #include "sp-object.h" #include "Layout-TNG-Scanline-Maker.h" +#include namespace Inkscape { namespace Text { @@ -1569,8 +1570,8 @@ bool Layout::Calculator::_buildChunksInScanRun(ParagraphInfo const ¶, new_span_height.computeEffective( new_span.start.iter_span->line_height_multiplier ); /* floating point 80-bit/64-bit rounding problems require epsilon. See discussion http://inkscape.gristle.org/2005-03-16.txt around 22:00 */ - if ( new_span_height.ascent > line_height->ascent + FLT_EPSILON || - new_span_height.descent > line_height->descent + FLT_EPSILON) { + if ( new_span_height.ascent > line_height->ascent + std::numeric_limits::epsilon() || + new_span_height.descent > line_height->descent + std::numeric_limits::epsilon() ) { // Take larger of each of the two ascents and two descents per CSS line_height->max(new_span_height); if (!_scanline_maker->canExtendCurrentScanline(*line_height)) { diff --git a/src/libnrtype/Layout-TNG-Scanline-Makers.cpp b/src/libnrtype/Layout-TNG-Scanline-Makers.cpp index dcc973a24..0d6112d19 100644 --- a/src/libnrtype/Layout-TNG-Scanline-Makers.cpp +++ b/src/libnrtype/Layout-TNG-Scanline-Makers.cpp @@ -11,6 +11,7 @@ #include "Layout-TNG-Scanline-Maker.h" #include "livarot/Shape.h" #include "livarot/float-line.h" +#include namespace Inkscape { namespace Text { @@ -43,7 +44,7 @@ std::vector Layout::InfiniteScanlineMaker::makeS { std::vector runs(1); runs[0].x_start = _x; - runs[0].x_end = FLT_MAX; // we could use DBL_MAX, but this just seems safer + runs[0].x_end = std::numeric_limits::max(); // we could use DBL_MAX, but this just seems safer runs[0].y = _y; _current_line_height = line_height; return runs; -- cgit v1.2.3