diff options
| author | Marc Jeanmougin <marc@jeanmougin.fr> | 2016-04-13 15:27:54 +0000 |
|---|---|---|
| committer | Marc Jeanmougin <marcjeanmougin@free.fr> | 2016-04-13 15:27:54 +0000 |
| commit | a18ef5710791412d906f09ed04f89d98d4952b9e (patch) | |
| tree | 3c52c724d40f355733486bf2d9e6eb6016fa195d /src | |
| parent | Remove no longer needed warning about feTile rendering. (diff) | |
| download | inkscape-a18ef5710791412d906f09ed04f89d98d4952b9e.tar.gz inkscape-a18ef5710791412d906f09ed04f89d98d4952b9e.zip | |
using cpp limits values
(bzr r14836)
Diffstat (limited to 'src')
| -rw-r--r-- | src/libnrtype/Layout-TNG-Compute.cpp | 5 | ||||
| -rw-r--r-- | 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 <limits> 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<float>::epsilon() || + new_span_height.descent > line_height->descent + std::numeric_limits<float>::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 <limits> namespace Inkscape { namespace Text { @@ -43,7 +44,7 @@ std::vector<Layout::ScanlineMaker::ScanRun> Layout::InfiniteScanlineMaker::makeS { std::vector<ScanRun> 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<float>::max(); // we could use DBL_MAX, but this just seems safer runs[0].y = _y; _current_line_height = line_height; return runs; |
