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

Wrong return type in SVGPathYFromX #47

Open
neven-s opened this issue Apr 8, 2022 · 1 comment
Open

Wrong return type in SVGPathYFromX #47

neven-s opened this issue Apr 8, 2022 · 1 comment

Comments

@neven-s
Copy link

neven-s commented Apr 8, 2022

Hello!

I believe there is an error on line:

return path.getPointAtLength(0)

Here the return type is DOMPoint while definition of function says it should be number.
I would presume the fix is adding .y at the end of line but I'm not sure of developers intentions.

This sometimes causes my app to crash with error
Invariant Violation: [5315,"RCTView",{"top":"<<NaN>>",...}] is not usable as a native method argument
because the return value is used as number in calculation of top property such as in

const y = SVGPathYFromX(this.properties, x)

top: ((1 - value) * startY) - cursorMarkerHeight / 2 + (y * value),

@neven-s neven-s changed the title Wrong return value in SVGPathYFromX Wrong return type in SVGPathYFromX Apr 8, 2022
@Kjagd
Copy link
Contributor

Kjagd commented Apr 28, 2022

Hey, sorry for the late reply. It sure looks like you are right, I'll try to take a look when I have time.

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

No branches or pull requests

2 participants