Created
October 28, 2013 19:01
-
-
Save springmeyer/7202602 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/include/mapnik/ctrans.hpp b/include/mapnik/ctrans.hpp | |
index f02ab48..2093e3d 100644 | |
--- a/include/mapnik/ctrans.hpp | |
+++ b/include/mapnik/ctrans.hpp | |
@@ -83,12 +83,21 @@ struct MAPNIK_DECL coord_transform | |
unsigned vertex(double *x, double *y) const | |
{ | |
- unsigned command = geom_.vertex(x, y); | |
- if ( command != SEG_END) | |
+ unsigned command = SEG_MOVETO; | |
+ bool ok = false; | |
+ bool skipped_points = false; | |
+ double z = 0; | |
+ while (!ok && command != SEG_END) | |
{ | |
- double z = 0; | |
- if (!prj_trans_->backward(*x, *y, z)) | |
- return SEG_END; | |
+ command = geom_.vertex(x, y); | |
+ ok = prj_trans_->backward(*x, *y, z); | |
+ if (!ok) { | |
+ skipped_points = true; | |
+ } | |
+ } | |
+ if (skipped_points && (command == SEG_LINETO)) | |
+ { | |
+ command = SEG_MOVETO; | |
} | |
t_->forward(x, y); | |
return command; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment