-
Notifications
You must be signed in to change notification settings - Fork 30
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
option to specify the "corner roundness" #140
Conversation
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.
Thanks! I left some comments on things I believe could be improved.
src/style.rs
Outdated
@@ -215,11 +224,12 @@ impl Size { | |||
} | |||
} | |||
|
|||
pub fn to_corner_radius(self) -> f32 { | |||
pub fn to_corner_roundness(self) -> f32 { |
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.
Why is this function needed? It always returns the same value, regardless of self
. At a glance, it also seems unused.
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.
that's right - I just forgot to remove it
src/style.rs
Outdated
@@ -18,6 +18,9 @@ pub struct Style { | |||
pub fill: bool, | |||
} | |||
|
|||
#[derive(Clone, Copy, Debug, Default)] | |||
pub struct Properties {} |
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.
Why do we need this struct?
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.
i don't really know - just needed a place to attach the getter function... maybe its better kept somewhere else. rust is really not my programming language
src/style.rs
Outdated
@@ -176,6 +179,12 @@ impl FromVariant for Size { | |||
} | |||
} | |||
|
|||
impl Properties { | |||
pub fn corner_roundness() -> f32 { |
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.
This seems a little redundant. Perhaps we could directly reference APP_CONFIG.read().corner_roundness()
where it's used.
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.
initially i thought of the need to differentiate between "Small", "Medium" and "Large" - thats why i've made a function. but of course would it be enough to have the numeric value.
if it's okay to reference APP_CONFIG directly in e.g. rectangle.rs, i can do this there.
great, thank you both! |
new option "corner-roundness". "0" means no corners. "12" is the default value (which draws corners of rectangle, blur and highlight round.