1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-30 13:20:05 -04:00

All Ui:s must now have a finite max_rect

Deprecated `max_rect_finite`, `available_size_before_wrap_finite`
and `available_rect_before_wrap_finite`.
This commit is contained in:
Emil Ernerfeldt
2021-08-28 16:02:16 +02:00
parent 105b999cb6
commit 9def6ef6df
18 changed files with 99 additions and 116 deletions

View File

@@ -53,18 +53,12 @@ impl super::View for LayoutTest {
if self.main_wrap {
if self.main_dir.is_horizontal() {
ui.allocate_ui(
vec2(
ui.available_size_before_wrap_finite().x,
self.wrap_row_height,
),
vec2(ui.available_size_before_wrap().x, self.wrap_row_height),
|ui| ui.with_layout(self.layout(), demo_ui),
);
} else {
ui.allocate_ui(
vec2(
self.wrap_column_width,
ui.available_size_before_wrap_finite().y,
),
vec2(self.wrap_column_width, ui.available_size_before_wrap().y),
|ui| ui.with_layout(self.layout(), demo_ui),
);
}

View File

@@ -63,7 +63,7 @@ impl super::View for MultiTouch {
// set up the drawing canvas with normalized coordinates:
let (response, painter) =
ui.allocate_painter(ui.available_size_before_wrap_finite(), Sense::drag());
ui.allocate_painter(ui.available_size_before_wrap(), Sense::drag());
// normalize painter coordinates to ±1 units in each direction with [0,0] in the center:
let painter_proportions = response.rect.square_proportions();
let to_screen = RectTransform::from_to(

View File

@@ -31,7 +31,7 @@ impl Painting {
pub fn ui_content(&mut self, ui: &mut Ui) -> egui::Response {
let (mut response, painter) =
ui.allocate_painter(ui.available_size_before_wrap_finite(), Sense::drag());
ui.allocate_painter(ui.available_size_before_wrap(), Sense::drag());
let to_screen = emath::RectTransform::from_to(
Rect::from_min_size(Pos2::ZERO, response.rect.square_proportions()),

View File

@@ -54,7 +54,7 @@ impl FractalClock {
let painter = Painter::new(
ui.ctx().clone(),
ui.layer_id(),
ui.available_rect_before_wrap_finite(),
ui.available_rect_before_wrap(),
);
self.paint(&painter);
// Make sure we allocate what we used (everything)