mirror of
https://github.com/emilk/egui.git
synced 2026-06-28 07:23:13 -04:00
A Window can now be resizable in only one direction (#4155)
For instance: `Window::new(…).resizable([true, false])` is a window that is only resizable in the horizontal direction. This PR also removes a hack added in https://github.com/emilk/egui/pull/3039 which is no longer needed since https://github.com/emilk/egui/pull/4026
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
use std::ops::{Add, AddAssign, Div, DivAssign, Mul, MulAssign, Neg, Sub, SubAssign};
|
||||
|
||||
use crate::Vec2b;
|
||||
|
||||
/// A vector has a direction and length.
|
||||
/// A [`Vec2`] is often used to represent a size.
|
||||
///
|
||||
@@ -86,6 +88,16 @@ impl From<&Vec2> for (f32, f32) {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Vec2b> for Vec2 {
|
||||
#[inline(always)]
|
||||
fn from(v: Vec2b) -> Self {
|
||||
Self {
|
||||
x: v.x as i32 as f32,
|
||||
y: v.y as i32 as f32,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Mint compatibility and convenience conversions
|
||||
|
||||
|
||||
Reference in New Issue
Block a user