1. placement_finder.cpp
fixed 'for' loops to work correctly when geom->num_points() < 2 always use prefix increment even for built-in types (good practice!) e.g ++i 2. agg_renderer.cpp check for number points in geometries when applying text/shield_symbolizer.
This commit is contained in:
parent
913b273f40
commit
00fd2a9f00
2 changed files with 10 additions and 8 deletions
|
@ -332,7 +332,7 @@ namespace mapnik
|
|||
proj_transform const& prj_trans)
|
||||
{
|
||||
geometry_ptr const& geom=feature.get_geometry();
|
||||
if (geom)
|
||||
if (geom && geom->num_points() > 0)
|
||||
{
|
||||
std::wstring text = to_unicode(feature[sym.get_name()].to_string());
|
||||
boost::shared_ptr<ImageData32> const& data = sym.get_data();
|
||||
|
@ -492,7 +492,7 @@ namespace mapnik
|
|||
{
|
||||
geometry_ptr const& geom=feature.get_geometry();
|
||||
|
||||
if (geom)
|
||||
if (geom && geom->num_points() > 0)
|
||||
{
|
||||
std::wstring text = to_unicode(feature[sym.get_name()].to_string());
|
||||
if (text.length() > 0)
|
||||
|
|
|
@ -75,7 +75,8 @@ namespace mapnik
|
|||
|
||||
shape_path.rewind(0);
|
||||
shape_path.vertex(&new_x,&new_y);
|
||||
for (unsigned i = 0; i < geom->num_points() - 1; i++)
|
||||
unsigned num_points = geom->num_points();
|
||||
for (unsigned i = 1; i < num_points; ++i)
|
||||
{
|
||||
double dx, dy;
|
||||
|
||||
|
@ -113,13 +114,13 @@ namespace mapnik
|
|||
shape_path.vertex(&old_x,&old_y);
|
||||
|
||||
total_distance_ = 0.0;
|
||||
|
||||
for (unsigned i = 0; i < geom->num_points() - 1; i++)
|
||||
|
||||
unsigned num_points = geom->num_points();
|
||||
for (unsigned i = 1; i < num_points ; ++i)
|
||||
{
|
||||
double dx, dy;
|
||||
|
||||
shape_path.vertex(&new_x,&new_y);
|
||||
|
||||
|
||||
dx = new_x - old_x;
|
||||
dy = new_y - old_y;
|
||||
|
||||
|
@ -330,7 +331,8 @@ namespace mapnik
|
|||
p->shape_path.vertex(&new_x,&new_y);
|
||||
old_x = new_x;
|
||||
old_y = new_y;
|
||||
for (unsigned i = 0; i < p->geom->num_points() - 1; i++)
|
||||
unsigned num_points = geom->num_points();
|
||||
for (unsigned i = 1; i < num_points; ++i)
|
||||
{
|
||||
double dx, dy;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue