pub struct Region { /* private fields */ }Expand description
An area of a window in logical pixels, built from rectangles, rounded
rectangles and ellipses joined with union,
subtract, intersect and
xor, applied in the order they are called.
PanelWindow::mask takes one: pointer
input outside it goes to whatever is below the window.
use crabshell_ui::Region;
// A 200 by 30 bar that only takes clicks at its two rounded ends.
let ends = Region::rect(0, 0, 40, 30)
.radius(8.0)
.union(Region::rect(160, 0, 40, 30).radius(8.0));Implementations§
Source§impl Region
impl Region
Sourcepub fn rect(x: i32, y: i32, width: u32, height: u32) -> Region
pub fn rect(x: i32, y: i32, width: u32, height: u32) -> Region
The rectangle at x, y, relative to the window’s top left.
Sourcepub fn ellipse(x: i32, y: i32, width: u32, height: u32) -> Region
pub fn ellipse(x: i32, y: i32, width: u32, height: u32) -> Region
The ellipse that fills the rectangle at x, y.
Sourcepub fn radius(self, radius: f32) -> Region
pub fn radius(self, radius: f32) -> Region
Rounds every corner of a rect. It does nothing to
other shapes.
Trait Implementations§
impl StructuralPartialEq for Region
Auto Trait Implementations§
impl Forget for Region
impl Freeze for Region
impl Move for Region
impl RefUnwindSafe for Region
impl Send for Region
impl Sync for Region
impl Unpin for Region
impl UnsafeUnpin for Region
impl UnwindSafe for Region
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more