1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-01 06:10:06 -04:00

Refactor: register grid drop-zones during the ui pass

This commit is contained in:
Emil Ernerfeldt
2023-05-04 10:57:46 +02:00
parent f5301b1761
commit e9b446b577
6 changed files with 98 additions and 54 deletions

View File

@@ -82,7 +82,12 @@ impl Rect {
}
#[inline(always)]
pub fn from_x_y_ranges(x_range: RangeInclusive<f32>, y_range: RangeInclusive<f32>) -> Self {
pub fn from_x_y_ranges(
x_range: impl Into<RangeInclusive<f32>>,
y_range: impl Into<RangeInclusive<f32>>,
) -> Self {
let x_range = x_range.into();
let y_range = y_range.into();
Rect {
min: pos2(*x_range.start(), *y_range.start()),
max: pos2(*x_range.end(), *y_range.end()),