Ticket #87: patch3.txt

File patch3.txt, 0.8 kB (added by kleptog, 8 months ago)
Line 
1Index: include/mapnik/ctrans.hpp
2===================================================================
3--- include/mapnik/ctrans.hpp   (revision 690)
4+++ include/mapnik/ctrans.hpp   (working copy)
5@@ -73,6 +73,8 @@
6          t_.forward(x,y);
7          return command;
8       }
9+     
10+      unsigned  num_points() { return geom_.num_points(); }
11         
12       void rewind (unsigned pos)
13       {
14Index: agg/include/agg_path_length.h
15===================================================================
16--- agg/include/agg_path_length.h       (revision 690)
17+++ agg/include/agg_path_length.h       (working copy)
18@@ -31,6 +31,9 @@
19         double y2 = 0.0;
20         bool first = true;
21 
22+        if( vs.num_points() <= 1 )
23+            return 0.0;
24+           
25         unsigned cmd;
26         vs.rewind(path_id);
27         while(!is_stop(cmd = vs.vertex(&x2, &y2)))