UiImage helper functions (#8199)
# Objective Add helper functions to `UiImage` for creating flipped images. ## Changelog * Added `with_flip_x` and `with_flip_y` methods to `UiImage` that return the `UiImage` flipped along the respective axis.
This commit is contained in:
parent
28046d5142
commit
ff9f2234f3
@ -758,6 +758,20 @@ impl UiImage {
|
||||
..Default::default()
|
||||
}
|
||||
}
|
||||
|
||||
/// flip the image along its x-axis
|
||||
#[must_use]
|
||||
pub const fn with_flip_x(mut self) -> Self {
|
||||
self.flip_x = true;
|
||||
self
|
||||
}
|
||||
|
||||
/// flip the image along its y-axis
|
||||
#[must_use]
|
||||
pub const fn with_flip_y(mut self) -> Self {
|
||||
self.flip_y = true;
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Handle<Image>> for UiImage {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user