-
-
Notifications
You must be signed in to change notification settings - Fork 205
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
Crashes only in iPads/live afther - Fix/enhancement for issue #1319 (draw filled complex polygons (concave/convex) #1546
Comments
@aismann help to take a look? |
Sure. Later.. Im currently on real life |
Ok. Here a workaround first: /** Is a polygon convex?
* @param verts A pointer to point coordinates.
* @param count The number of verts measured in points.
*/
static inline bool isConvex(const Vec2* verts, int count)
{
return true; // Workaroud for issue #1546 |
The fix in the next PR: @rarepixels |
@rarepixels void DrawNode::drawPolygon(const Vec2* verts,
int count,
const Color4B& fillColor,
float borderWidth,
const Color4B& borderColor)
{
for (size_t i = 0; i < count; i++)
{
AXLOG("Count %i x: %f y: %f", i, verts[i].x, verts[i].y);
}
..... |
Hi @aismann, I just remove the version with the concave code to avoid the crashes. Luckily for me, the apple guys did the review very fast. I never manage to reproduce the problem in development with my ipads, but I will try to force it, and if I manage to trigger the crash during this days test, I will send you the logs. If not, I will setup a live version, that logs the crash, and jumps to the old drawing code, so we can see what goes wrong, but the user will not be affected. |
I trink i have found the bug. |
A part of the resolution of the device, I have no differences at all in my code, not for android or ios devices, For me, there is no hurry at all @aismann, thanks. If you have already find the problem that will be great, |
@rarepixels |
@rarepixels , Can you also log the vertices value? |
* Fix issue #1546 of UILayout(#1549) and small performance boost * add test * Committing genbindings changes --------- Co-authored-by: aismann <[email protected]>
@aismann , Thanks for your job, I will be updating all changes and I will let you know and record the logs, if I found again the problem. Thanks! |
I hope you never found this issue again ;) |
No idea, but I will remain also very curious about that.... In my crash reports I found no reason to group the problem, except "device type iPad" The fact that is random, is also weird, as almost no ipad users had the crash repeated. |
* Fix issue #1546 of UILayout(#1549) and small performance boost * add test * Update DrawPrimitivesTest.cpp (Smaller tester code) * Update DrawNodeEx.h AX_EX_DLL * Update AXLinkHelpers.cmake * Update Console.cpp (removed the '\n' which creates an second (empty) line) * segment stuff * . * add some more tests * Issue 1888 * . * add all DrawNode cocos2dx * . * . * . * add feature for drawing in correct order * . * Update DrawNodeEx.cpp * . * Update DrawNodeEx.cpp * DRAWNODE_TRIANGLE_ONLY * DRAWNODE_DRAW_LINE_POINT * . * Update DrawNodeExTest.cpp * Update DrawNodeExTest.cpp * . * . * Add round brackets * commendet this both lines (check it in next version) * .
axmol version:
Still using last 1.x, not yet migrated to 2.x,no dev, but wanna give a heads up, in case somebody else have this problem.
devices test on:
Only crashes in iPads / no dev crashes for me, only live crashlytics reports
No problem at all in android devices or any iPhone model/version
developing environments
I had recently updated my app version with the fix for issuea #1433 and got this crash trigger by poly2tri shapes.h
// Repeat points
"Edge::Edge: p1 == p2"
Removing the changes for concave/convex detection crashes went away.
All crashes are related to the drawPolygon, all in pages with ScrollView,
that calls drawPolygon twice via
Layout::setStencilClippingSize _clippingStencil->drawPolygon
ScrollView:create -> triggers a drawPolygon with 0 filled
scrollView::setContentSize -> in my test case, triggers drawPolygon with screenSize ~ [0,0] [1386,0] [1386,518] [0,518]
Or in the few places where I draw polygons ( only rectangles or round rectangles, so all are convex )
Of course, I can't reproduce the crash and never run into it during development or testing.
From crashlytics:
Device
100% iPad
In my case,
iPad (5th to 10th generation )
iPad Pro ( 2th to 6th )
iPad Air ( 3rd to 4th )
iPad mini ( 4th to 5th )
OS
60% iPadOS 17
32% iPAdOS 16
7% iPAdOS 15
1% iPadOS 14
Version 4.2 has the update #1433 , prev versions, and 4.2.1 do not have that code change.
The text was updated successfully, but these errors were encountered: