Marker symbolizer: Fix bug with lines with 0 length (division by zero)
This commit is contained in:
parent
b7e486d3c3
commit
0195047d7a
1 changed files with 6 additions and 0 deletions
|
@ -314,6 +314,12 @@ bool middle_point(PathType & path, double & x, double & y, boost::optional<doubl
|
||||||
path.rewind(0);
|
path.rewind(0);
|
||||||
unsigned command = path.vertex(&x0,&y0);
|
unsigned command = path.vertex(&x0,&y0);
|
||||||
if (command == SEG_END) return false;
|
if (command == SEG_END) return false;
|
||||||
|
if (std::abs(mid_length) < std::numeric_limits<double>::epsilon())
|
||||||
|
{
|
||||||
|
x = x0;
|
||||||
|
y = y0;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
double dist = 0.0;
|
double dist = 0.0;
|
||||||
while (SEG_END != (command = path.vertex(&x1, &y1)))
|
while (SEG_END != (command = path.vertex(&x1, &y1)))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue