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

Some font awesome shapes fail to render #88

Open
samreid opened this issue Feb 6, 2021 · 1 comment
Open

Some font awesome shapes fail to render #88

samreid opened this issue Feb 6, 2021 · 1 comment
Assignees

Comments

@samreid
Copy link
Member

samreid commented Feb 6, 2021

From phetsims/sherpa#81.

These icons throw errors during Shape construction:

Amazon
Aviato
Bitcoin
CanadianMapleLeaf
CcAmex
CcJcb
CcVisa
Confluence
DAndDBeyond
Discord
Discourse
DumpsterFire
Ember
Evernote
FilePdf
FireAlt
FirefoxBrowser
FreeCodeCamp
Frog
GithubSquare
Grav
Gripfire
Grunt
Hooli
Hornbill
ItchIo
ItunesNote
Java
JediOrder
Jira
Keycdn
KissWinkHeart
Language
Lastfm
Lyft
Mdb
Napster
Odnoklassniki
Pagelines
Paypal
Phabricator
PinterestSquare
Playstation
Pushed
PuzzlePiece
RProject
Rebel
Ribbon
Rockrms
Salesforce
Sass
Shopify
Studiovinari
StumbleuponCircle
Usps
Viber
Vnv
WatchmanMonitoring
Wix
WizardsOfTheCoast
Wordpress
Yarn
YoutubeSquare
Zhihu

For instance, Amazon throws this error (when asserts are enabled):

Vector2.js:256 Uncaught Error: Cannot normalize a zero-magnitude vector
    at Vector2.normalized (Vector2.js:256)
    at Cubic.getEndTangent (Cubic.js:361)
    at Cubic.get endTangent [as endTangent] (Cubic.js:365)
    at Subpath.addSegmentDirectly (Subpath.js:165)
    at Subpath.addSegment (Subpath.js:187)
    at Shape.addSegmentAndBounds (Shape.js:1744)
    at Shape.js:596
    at u (lodash-4.17.4.min.js:5)
    at Function.ru (lodash-4.17.4.min.js:67)
    at Shape.cubicCurveToPoint (Shape.js:595)

I saw another failure mode with assertions disabled, but cannot figure out which icon(s) it was for, where NaN are leaking into the path commands.

@samreid
Copy link
Member Author

samreid commented Feb 6, 2021

If I disable assertions, Amazon seems to render OK, add this line to any screenView:

this.addChild( new Amazon( { fill: 'black' } ) );

image

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

No branches or pull requests

2 participants