fix ambiguous std::fabs and the compile on windows

This commit is contained in:
Dane Springmeyer 2014-05-22 19:57:34 -07:00
parent bb67ae0fb7
commit 468ead3370
2 changed files with 8 additions and 8 deletions

View file

@ -108,10 +108,10 @@ void agg_renderer<T>::process(raster_symbolizer const& sym,
double image_ratio_x = ext.width() / source->data_.width(); double image_ratio_x = ext.width() / source->data_.width();
double image_ratio_y = ext.height() / source->data_.height(); double image_ratio_y = ext.height() / source->data_.height();
double eps = 1e-5; double eps = 1e-5;
if ( (std::fabs(image_ratio_x - 1) <= eps) && if ( (std::fabs(image_ratio_x - 1.0) <= eps) &&
(std::fabs(image_ratio_y - 1) <= eps) && (std::fabs(image_ratio_y - 1.0) <= eps) &&
(std::fabs(start_x) <= eps) && (std::abs(start_x) <= eps) &&
(std::fabs(start_y) <= eps) ) (std::abs(start_y) <= eps) )
{ {
composite(current_buffer_->data(), source->data_, composite(current_buffer_->data(), source->data_,
sym.comp_op(), sym.get_opacity(), sym.comp_op(), sym.get_opacity(),

View file

@ -939,10 +939,10 @@ void cairo_renderer_base::process(raster_symbolizer const& sym,
double image_ratio_x = ext.width() / source->data_.width(); double image_ratio_x = ext.width() / source->data_.width();
double image_ratio_y = ext.height() / source->data_.height(); double image_ratio_y = ext.height() / source->data_.height();
double eps = 1e-5; double eps = 1e-5;
if ( (std::fabs(image_ratio_x - 1) <= eps) && if ( (std::fabs(image_ratio_x - 1.0) <= eps) &&
(std::fabs(image_ratio_y - 1) <= eps) && (std::fabs(image_ratio_y - 1.0) <= eps) &&
(std::fabs(start_x) <= eps) && (std::abs(start_x) <= eps) &&
(std::fabs(start_y) <= eps) ) (std::abs(start_y) <= eps) )
{ {
cairo_save_restore guard(context_); cairo_save_restore guard(context_);
context_.set_operator(sym.comp_op()); context_.set_operator(sym.comp_op());