summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJovansonlee Cesar <ivanceras@gmail.com>2021-07-12 16:33:00 +0800
committerJovansonlee Cesar <ivanceras@gmail.com>2021-07-12 16:33:00 +0800
commitf662289512e4e3f4e5dc3ec843b54c4039aa22e3 (patch)
treedacd2df77371fec06f1e84c529e443831afa90be
parent56eb72956a9b23c8f955971479f65c7cccc882c2 (diff)
Add a public function for Rect fragment to determine whether it is using a rounded rectangle or not
-rw-r--r--svgbob/src/buffer/fragment_buffer/fragment/rect.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/svgbob/src/buffer/fragment_buffer/fragment/rect.rs b/svgbob/src/buffer/fragment_buffer/fragment/rect.rs
index 51f8481..a74cc6c 100644
--- a/svgbob/src/buffer/fragment_buffer/fragment/rect.rs
+++ b/svgbob/src/buffer/fragment_buffer/fragment/rect.rs
@@ -97,6 +97,14 @@ impl Rect {
pub(crate) fn is_broken(&self) -> bool {
self.is_broken
}
+
+ pub fn is_rounded(&self) -> bool {
+ if let Some(ref r) = &self.radius {
+ *r > 0.0
+ } else {
+ false
+ }
+ }
}
impl Bounds for Rect {