-
Notifications
You must be signed in to change notification settings - Fork 463
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 bug in Coons Patches + API alignement + Example #164
Conversation
@@ -3,7 +3,7 @@ import { StyleSheet, View } from "react-native"; | |||
|
|||
import { HomeScreenButton } from "./HomeScreenButton"; | |||
|
|||
export const HomeScreen: React.FC = () => { | |||
export const HomeScreen = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a note: I like using React.FC in component declarations since they enforce a few extra things like the return value of the function being correct. We'll go without it for now - just wanted to mention it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have tested on both iOS/Android and it seems to be working nice.
@@ -122,8 +122,8 @@ namespace RNSkia | |||
// verify size of input uniforms | |||
if (jsiUniformsSize * sizeof(float) != getObject()->uniformSize()) | |||
{ | |||
jsi::detail::throwJSError( | |||
runtime, "Uniforms size differs from effect's uniform size."); | |||
std::string msg = "Uniforms size differs from effect's uniform size. Received " + std::to_string(jsiUniformsSize) + " expected " + std::to_string(getObject()->uniformSize() / sizeof(float)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Long line - should have some line breaks :)
There was a serious bug in the order of the points we were providing to Skia.
The API has been updated to be more symmetric with the Vertices API.
In terms of the parameters to provide, there are many we could do there and I am up to discussing them.
We can potentially provide support for different input shapes.
The current API requires you to think of a Coons Patch as 4 cornes with 2 cubic Bezier handle per corner.
In the use case of the example (with movable handles), it works seamlessly. There might be some other use cases where an input of a different shape makes sense, (when given curves directly for instance). We could definitely provide some utility functions there.