diff --git a/CHANGELOG.md b/CHANGELOG.md index 8209dcda..da5bc961 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ * Add ability to override text color with `visuals.override_text_color` * Refactored the interface for `egui::app::App` * Demo App: Add slider to scale all of Egui +* Fix a bug where some regions would slowly grow for non-integral scales (`pixels_per_point`). ## 0.2.0 - 2020-10-10 diff --git a/egui/src/containers/area.rs b/egui/src/containers/area.rs index 73c2fb0f..4e1f2143 100644 --- a/egui/src/containers/area.rs +++ b/egui/src/containers/area.rs @@ -173,7 +173,7 @@ impl Prepared { movable, } = self; - state.size = (content_ui.min_rect().max - state.pos).ceil(); + state.size = content_ui.min_rect().size(); let rect = Rect::from_min_size(state.pos, state.size); let clip_rect = Rect::everything(); // TODO: get from context diff --git a/egui/src/containers/resize.rs b/egui/src/containers/resize.rs index 898e1006..63232b7d 100644 --- a/egui/src/containers/resize.rs +++ b/egui/src/containers/resize.rs @@ -240,7 +240,6 @@ impl Resize { } = prepared; state.last_content_size = content_ui.min_size(); - state.last_content_size = state.last_content_size.ceil(); // Avoid rounding errors in math // ------------------------------ @@ -249,7 +248,6 @@ impl Resize { // so we must follow the contents: state.desired_size = state.desired_size.max(state.last_content_size); - state.desired_size = ui.painter().round_vec_to_pixels(state.desired_size); // We are as large as we look ui.allocate_space(state.desired_size); diff --git a/egui/src/ui.rs b/egui/src/ui.rs index 251136ca..0602f9a2 100644 --- a/egui/src/ui.rs +++ b/egui/src/ui.rs @@ -438,9 +438,6 @@ impl Ui { /// /// You may get LESS space than you asked for if the current layout won't fit what you asked for. pub fn allocate_space(&mut self, desired_size: Vec2) -> Rect { - let desired_size = self.painter().round_vec_to_pixels(desired_size); - self.cursor = self.painter().round_pos_to_pixels(self.cursor); - // For debug rendering let too_wide = desired_size.x > self.available().width(); let too_high = desired_size.x > self.available().height();