mirror of
https://github.com/emilk/egui.git
synced 2026-08-30 13:20:05 -04:00
Some minor fixes and additions
This commit is contained in:
@@ -308,6 +308,10 @@ impl Region {
|
||||
self.available_space.y
|
||||
}
|
||||
|
||||
pub fn size(&self) -> Vec2 {
|
||||
self.available_space
|
||||
}
|
||||
|
||||
pub fn direction(&self) -> Direction {
|
||||
self.dir
|
||||
}
|
||||
|
||||
@@ -40,6 +40,14 @@ impl Vec2 {
|
||||
}
|
||||
}
|
||||
|
||||
impl std::ops::Neg for Vec2 {
|
||||
type Output = Vec2;
|
||||
|
||||
fn neg(self) -> Vec2 {
|
||||
vec2(-self.x, -self.y)
|
||||
}
|
||||
}
|
||||
|
||||
impl std::ops::AddAssign for Vec2 {
|
||||
fn add_assign(&mut self, rhs: Vec2) {
|
||||
*self = Vec2 {
|
||||
|
||||
@@ -83,7 +83,7 @@ pub struct Outline {
|
||||
pub color: Color,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize)] // TODO: copy
|
||||
#[derive(Clone, Debug, Serialize)]
|
||||
#[serde(rename_all = "snake_case", tag = "kind")]
|
||||
pub enum PaintCmd {
|
||||
Circle {
|
||||
|
||||
@@ -247,7 +247,7 @@ impl Widget for RadioButton {
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
pub struct Slider<'a> {
|
||||
get_set_value: Box<'a + FnMut(Option<f32>) -> f32>,
|
||||
get_set_value: Box<dyn 'a + FnMut(Option<f32>) -> f32>,
|
||||
min: f32,
|
||||
max: f32,
|
||||
id: Option<Id>,
|
||||
|
||||
Reference in New Issue
Block a user