Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f8181c9

Browse filesBrowse files
committed
FIX: when iterating through segments skip 0 length segments
One method to fix #15842 In this case we check in `path_intersect_path` that as we iterate through the segments, if we hit a 0 length segment we grab the next vertex before checking if the segments from the two paths intersect.
1 parent a06d8e9 commit f8181c9
Copy full SHA for f8181c9

File tree

Expand file treeCollapse file tree

1 file changed

+9
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+9
-0
lines changed

‎src/_path.h

Copy file name to clipboardExpand all lines: src/_path.h
+9Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -887,9 +887,18 @@ bool path_intersects_path(PathIterator1 &p1, PathIterator2 &p2)
887887

888888
c1.vertex(&x11, &y11);
889889
while (c1.vertex(&x12, &y12) != agg::path_cmd_stop) {
890+
// if the segment in path 1 is 0 length, skip to next vertex
891+
if ((x11 == x12) && (y11 == y12)) {
892+
continue;
893+
}
890894
c2.rewind(0);
891895
c2.vertex(&x21, &y21);
896+
892897
while (c2.vertex(&x22, &y22) != agg::path_cmd_stop) {
898+
// if the segment in path 2 is 0 length, skip to next vertex
899+
if ((x21 == x22) && (y21 == y22)) {
900+
continue;
901+
}
893902
if (segments_intersect(x11, y11, x12, y12, x21, y21, x22, y22)) {
894903
return true;
895904
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.