summaryrefslogtreecommitdiffstats
path: root/src/libnrtype
diff options
context:
space:
mode:
authorMarc Jeanmougin <marc@jeanmougin.fr>2016-04-13 15:27:54 +0000
committerMarc Jeanmougin <marcjeanmougin@free.fr>2016-04-13 15:27:54 +0000
commita18ef5710791412d906f09ed04f89d98d4952b9e (patch)
tree3c52c724d40f355733486bf2d9e6eb6016fa195d /src/libnrtype
parentRemove no longer needed warning about feTile rendering. (diff)
downloadinkscape-a18ef5710791412d906f09ed04f89d98d4952b9e.tar.gz
inkscape-a18ef5710791412d906f09ed04f89d98d4952b9e.zip
using cpp limits values
(bzr r14836)
Diffstat (limited to 'src/libnrtype')
-rw-r--r--src/libnrtype/Layout-TNG-Compute.cpp5
-rw-r--r--src/libnrtype/Layout-TNG-Scanline-Makers.cpp3
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 &para,
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;