mirror of
https://github.com/emilk/egui.git
synced 2026-08-31 05:40:03 -04:00
Simplify and unify queries about available space
This commit is contained in:
@@ -354,7 +354,7 @@ impl Painting {
|
||||
|
||||
ui.add_custom_contents(vec2(f32::INFINITY, 200.0), |ui| {
|
||||
let canvas_corner = ui.cursor();
|
||||
let interact = ui.reserve_space(ui.available_space(), Some(ui.id()));
|
||||
let interact = ui.reserve_space(ui.available().size(), Some(ui.id()));
|
||||
ui.set_clip_rect(ui.clip_rect().intersect(interact.rect)); // Make sure we don't paint out of bounds
|
||||
|
||||
if self.lines.is_empty() {
|
||||
|
||||
@@ -123,7 +123,7 @@ impl FractalClock {
|
||||
Hand::from_length_angle(0.5, angle_from_period(12.0 * 60.0 * 60.0)),
|
||||
];
|
||||
|
||||
let rect = ui.available_rect_min();
|
||||
let rect = ui.available_finite();
|
||||
|
||||
let scale = self.zoom * rect.width().min(rect.height());
|
||||
let mut paint_line = |points: [Pos2; 2], color: Color, width: f32| {
|
||||
|
||||
Reference in New Issue
Block a user