Skip to content

Conversation

adielfernandez
Copy link
Contributor

@adielfernandez adielfernandez commented Aug 27, 2018

Needed it for WetlandData so I added some ci::Anim's and tweaked the shader to allow for changing the radii of individual corners. See ViewTypesSample app for use case. The conditional in the shader isn't ideal, of course, but I can't imagine any perceivable slowdowns.

Feel free to make changes to for styling consistency/preference. Probably should have changed useUniformCorners(bool use) to setUniformCorners(bool use)

Copy link
Collaborator

@benjaminbojko benjaminbojko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Thanks for putting this together. Instead of toggling with the boolean, can we just use 4 radii by default?

We could have a few versions of setCornerRadius():

setCornerRadius(float radius); // sets all radii
setCornerRadius(float top, float right, float bottom, float left); // individual

Then the shader can lose one if/else and we can be a bit more clear about what's happening. The only thing I get that's complicated then is animating the radius globally... Is that why you had it broken out like that?

@adielfernandez
Copy link
Contributor Author

Yeah, that makes sense! Will add it in shortly.

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.

2 participants