marc2332 / freya

Cross-platform GUI library for 🦀 Rust powered by 🧬 Dioxus and 🎨 Skia.
https://freyaui.dev/
MIT License
1.33k stars 51 forks source link

fix: Consider corner radius for events and overflow clipping #768

Closed marc2332 closed 1 month ago

marc2332 commented 1 month ago

Closes https://github.com/marc2332/freya/issues/767

marc2332 commented 1 month ago

I am still not 100% sold in the implementation because it is only applying the viewport when rendering visually, so, events will still ignore the corner radius. I might have to rethink the viewports general idea

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 19.20668% with 387 lines in your changes missing coverage. Please review.

Project coverage is 73.63%. Comparing base (1955629) to head (5b0981e).

Files Patch % Lines
crates/core/src/elements/rect.rs 17.48% 151 Missing :warning:
crates/core/src/skia/skia_renderer.rs 0.00% 77 Missing :warning:
crates/core/src/elements/paragraph.rs 0.00% 52 Missing :warning:
crates/core/src/elements/image.rs 0.00% 37 Missing :warning:
crates/core/src/elements/svg.rs 0.00% 26 Missing :warning:
crates/core/src/elements/label.rs 0.00% 24 Missing :warning:
crates/core/src/elements/utils.rs 61.53% 10 Missing :warning:
crates/renderer/src/app.rs 0.00% 7 Missing :warning:
crates/core/src/events/events_measurer.rs 93.10% 2 Missing :warning:
crates/testing/src/test_handler.rs 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #768 +/- ## ========================================== - Coverage 73.66% 73.63% -0.03% ========================================== Files 199 200 +1 Lines 20377 20487 +110 ========================================== + Hits 15011 15086 +75 - Misses 5366 5401 +35 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

marc2332 commented 1 month ago

I am still not 100% sold in the implementation because it is only applying the viewport when rendering visually, so, events will still ignore the corner radius. I might have to rethink the viewports general idea

This should be easy to do. Will try it asap

marc2332 commented 1 month ago

I am still not 100% sold in the implementation because it is only applying the viewport when rendering visually, so, events will still ignore the corner radius. I might have to rethink the viewports general idea

This should be easy to do. Will try it asap

done!

marc2332 commented 1 month ago

todo: avoid dynamic dispatch