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

Cannot use custom radii for rounded rectangle #2395

Closed
ava-m-c opened this issue Apr 22, 2024 · 2 comments
Closed

Cannot use custom radii for rounded rectangle #2395

ava-m-c opened this issue Apr 22, 2024 · 2 comments

Comments

@ava-m-c
Copy link

ava-m-c commented Apr 22, 2024

I tried to create a rectangle with only the top corners to be rounded, but this always gives me a runtime error, despite following the format from the documentation. I tried to use it like this

const barPath = Skia.Path.Make();
barPath.addRRect({
  rect: { x, y, width, height },
  topLeft: { x: r, y: r },
  topRight: { x: r, y: r },
  bottomLeft: { x: 0, y: 0 },
  bottomRight: { x: 0, y: 0 },
});

I followed the described format from the documentation and the allowed type as I find it in the TS code. However, I still get a runtime error saying 'Exception in HostFunction: Value is undefined, expected a number'. I get a runtime error for both the Path.Make method and using the RoundedRect component directly.
Despite using the right TS type (that gives me no error), it seems it still expects a radius prop at runtime, ignoring the valid alternative type using the top/bottom/Left/Right props. So, it seems to me something might go wrong somewhere behind the scenes in the source code when handling these.

Originally posted by @ava-m-c in #2371 (comment)

@KathySunrun
Copy link

i see same issue. Pls help.

@ava-m-c
Copy link
Author

ava-m-c commented Jul 26, 2024

Seems to be fixed in the newer versions.

@ava-m-c ava-m-c closed this as completed Jul 26, 2024
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

No branches or pull requests

2 participants