Handle large errors in marker placement.

Closes #1485.
This commit is contained in:
Hermann Kraus 2013-04-01 05:27:13 +02:00
parent ded74f6db3
commit 5f137bcc28

View file

@ -151,10 +151,9 @@ public:
//Error for this marker is too large. Skip to the next position.
if (std::fabs(error_) > max_err_allowed)
{
if (error_ > spacing_)
while (error_ > spacing_)
{
MAPNIK_LOG_WARN(markers_placement) << "Extremely large error (" << error_ << ") in markers_placement. Please file a bug report.";
error_ = 0.0; //Avoid moving backwards
error_ -= spacing_; //Avoid moving backwards
}
spacing_left_ += spacing_ - error_;
error_ = 0.0;