-
Notifications
You must be signed in to change notification settings - Fork 7.1k
fix concave polygon bug in DrawNode #19641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -265,6 +265,10 @@ DrawNodeTest::DrawNodeTest() | |
Vec2 points[] = { Vec2(s.height/4,0), Vec2(s.width,s.height/5), Vec2(s.width/3*2,s.height) }; | ||
draw->drawPolygon(points, sizeof(points)/sizeof(points[0]), Color4F(1,0,0,0.5), 4, Color4F(0,0,1,0.5)); | ||
|
||
// Draw concave polygons | ||
Vec2 concavePoints[] = { Vec2(0,130), Vec2(140,130), Vec2(140,160),Vec2(120,145),Vec2(30,145),Vec2(0,160) }; | ||
draw->drawPolygon(concavePoints, sizeof(concavePoints)/sizeof(concavePoints[0]), Color4F(1,0,0,0.5), 4, Color4F(0,0,1,0.5)); | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it is better to add a separate test case, or it is hard to catch the error. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok,I added a test class : Issue19641Test in the new commit .And I moved that code into Issue19641Test. |
||
// star poly (triggers buggs) | ||
{ | ||
const float o=80; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is better to add the url of the codes comes from.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The url is http://www.flipcode.com/archives/Efficient_Polygon_Triangulation.shtml.
I wrote the url in the first comment up there. Do you mean that I need write the url into the source code's comment ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, i think it is better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I've added in the new commit.