Skip to content
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

Fix for when '_segmentsCount' can return NaN #6231

Merged
merged 3 commits into from Jan 16, 2020
Merged

Conversation

themoonrat
Copy link
Member

If the moveTo y value and the quadraticCurveTo cpY and toY values are all the same, then QuadraticUtils.curveLength returns NaN, causing GRAPHICS_CURVES._segmentsCount to return NaN.

Demo: https://www.pixiplayground.com/#/edit/8jAg09k2W~L85zPt~ZfU_
Open up the console, put a breakpoint on const n = GRAPHICS_CURVES._segmentsCount and refresh the playground. Notice that 'n' will resolve to NaN.

This is probably not the right solution for this, fixing the symptom rather than the cause, but just in case it's fine, here's the PR!

@themoonrat themoonrat changed the title Fix for when '_segmentsCount' can return NaN' Fix for when '_segmentsCount' can return NaN Nov 21, 2019
@bigtimebuddy bigtimebuddy added this to the v5.2.1 milestone Nov 24, 2019
@codecov-io
Copy link

codecov-io commented Nov 24, 2019

Codecov Report

Merging #6231 into dev will increase coverage by 0.93%.
The diff coverage is 86.57%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev    #6231      +/-   ##
==========================================
+ Coverage   76.98%   77.92%   +0.93%     
==========================================
  Files         202      186      -16     
  Lines       10238    10109     -129     
==========================================
- Hits         7882     7877       -5     
+ Misses       2356     2232     -124
Impacted Files Coverage Δ
packages/display/src/Bounds.js 91.04% <ø> (-0.05%) ⬇️
packages/sprite-tiling/src/TilingSprite.js 71.59% <ø> (ø) ⬆️
...kages/settings/src/utils/maxRecommendedTextures.js 18.75% <ø> (ø) ⬆️
packages/settings/src/settings.js 100% <ø> (ø) ⬆️
packages/text-bitmap/src/BitmapFontLoader.js 75% <ø> (ø) ⬆️
packages/settings/src/utils/canUploadSameBuffer.js 100% <ø> (ø) ⬆️
packages/mesh/src/Mesh.js 61.48% <0%> (-0.42%) ⬇️
packages/sprite/src/Sprite.js 92.15% <0%> (-0.46%) ⬇️
packages/sprite-tiling/src/TilingSpriteRenderer.js 7.27% <0%> (-0.28%) ⬇️
packages/core/src/shader/utils/compileProgram.js 56.66% <0%> (-7.62%) ⬇️
... and 21 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e05e36d...c471e97. Read the comment docs.

@bigtimebuddy bigtimebuddy merged commit 1a78618 into dev Jan 16, 2020
@bigtimebuddy bigtimebuddy deleted the dev-segmentsCount-fix branch January 16, 2020 05:12
@bigtimebuddy
Copy link
Member

Thanks @themoonrat!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants