summaryrefslogtreecommitdiff
path: root/external/libpagemaker/0003-round-is-not-available-on-windows.patch
blob: e13d7056f15d55081b18cd59764864b4207a95f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
From e5700eff3f09a6c0b78663b397c141f677c5b16b Mon Sep 17 00:00:00 2001
From: David Tardon <dtardon@redhat.com>
Date: Fri, 27 Jun 2014 11:33:09 +0200
Subject: [PATCH 3/3] round is not available on windows

---
 src/lib/PMDParser.cpp | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/lib/PMDParser.cpp b/src/lib/PMDParser.cpp
index 7c9ff2d..736ea1c 100644
--- a/src/lib/PMDParser.cpp
+++ b/src/lib/PMDParser.cpp
@@ -12,7 +12,6 @@
 #include <cassert>
 #include <vector>
 #include <limits>
-#include <math.h>
 #include <librevenge/librevenge.h>
 #include <boost/optional.hpp>
 #include <boost/shared_ptr.hpp>
@@ -608,9 +607,9 @@ void PMDParser::parseColors(const PMDRecordContainer &container)
 
       uint16_t max = (std::numeric_limits<uint16_t>::max)();
 
-      red = 255* round((1 - std::min(1.0, (double)cyan/max + (double)black/max)));
-      green = 255*round((1 - std::min(1.0, (double)magenta/max + (double)black/max)));
-      blue = 255*round((1 - std::min(1.0, (double)yellow/max + (double)black/max)));
+      red = 255* std::floor((1 - std::min(1.0, (double)cyan/max + (double)black/max) + 0.5));
+      green = 255*std::floor((1 - std::min(1.0, (double)magenta/max + (double)black/max) + 0.5));
+      blue = 255*std::floor((1 - std::min(1.0, (double)yellow/max + (double)black/max) + 0.5));
     }
     else if (colorModel == HLS)
     { }
-- 
1.9.3