use math functions from std::
This commit is contained in:
parent
a010195b36
commit
4ef9cd8b45
1 changed files with 10 additions and 9 deletions
|
@ -30,9 +30,10 @@
|
||||||
#include <boost/spirit/include/qi.hpp>
|
#include <boost/spirit/include/qi.hpp>
|
||||||
#include <boost/spirit/include/phoenix_core.hpp>
|
#include <boost/spirit/include/phoenix_core.hpp>
|
||||||
#include <boost/spirit/include/phoenix_stl.hpp>
|
#include <boost/spirit/include/phoenix_stl.hpp>
|
||||||
|
|
||||||
#include <boost/property_tree/ptree.hpp>
|
#include <boost/property_tree/ptree.hpp>
|
||||||
|
|
||||||
|
#include <cmath>
|
||||||
|
|
||||||
namespace mapnik
|
namespace mapnik
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -70,28 +71,28 @@ bool text_placement_info_simple::next_position_only()
|
||||||
displacement = pdisp;
|
displacement = pdisp;
|
||||||
break;
|
break;
|
||||||
case NORTH:
|
case NORTH:
|
||||||
displacement.set(0, -abs(pdisp.y));
|
displacement.set(0, -std::abs(pdisp.y));
|
||||||
break;
|
break;
|
||||||
case EAST:
|
case EAST:
|
||||||
displacement.set(abs(pdisp.x), 0);
|
displacement.set(std::abs(pdisp.x), 0);
|
||||||
break;
|
break;
|
||||||
case SOUTH:
|
case SOUTH:
|
||||||
displacement.set(0, abs(pdisp.y));
|
displacement.set(0, std::abs(pdisp.y));
|
||||||
break;
|
break;
|
||||||
case WEST:
|
case WEST:
|
||||||
displacement.set(-abs(pdisp.x), 0);
|
displacement.set(-std::abs(pdisp.x), 0);
|
||||||
break;
|
break;
|
||||||
case NORTHEAST:
|
case NORTHEAST:
|
||||||
displacement.set(abs(pdisp.x), -abs(pdisp.y));
|
displacement.set(std::abs(pdisp.x), -std::abs(pdisp.y));
|
||||||
break;
|
break;
|
||||||
case SOUTHEAST:
|
case SOUTHEAST:
|
||||||
displacement.set(abs(pdisp.x), abs(pdisp.y));
|
displacement.set(std::abs(pdisp.x), std::abs(pdisp.y));
|
||||||
break;
|
break;
|
||||||
case NORTHWEST:
|
case NORTHWEST:
|
||||||
displacement.set(-abs(pdisp.x), -abs(pdisp.y));
|
displacement.set(-std::abs(pdisp.x), -std::abs(pdisp.y));
|
||||||
break;
|
break;
|
||||||
case SOUTHWEST:
|
case SOUTHWEST:
|
||||||
displacement.set(-abs(pdisp.x), abs(pdisp.y));
|
displacement.set(-std::abs(pdisp.x), std::abs(pdisp.y));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
MAPNIK_LOG_WARN(text_placements) << "Unknown placement";
|
MAPNIK_LOG_WARN(text_placements) << "Unknown placement";
|
||||||
|
|
Loading…
Reference in a new issue