mirror of
https://github.com/emilk/egui.git
synced 2026-09-02 14:50:03 -04:00
Adjust default-size of Resize areas to fit within screen
This commit is contained in:
@@ -165,7 +165,10 @@ impl Resize {
|
|||||||
let default_size = self
|
let default_size = self
|
||||||
.default_size
|
.default_size
|
||||||
.at_least(self.min_size)
|
.at_least(self.min_size)
|
||||||
.at_most(self.max_size);
|
.at_most(self.max_size)
|
||||||
|
.at_most(
|
||||||
|
ui.input().screen_rect().size() - 2.0 * ui.style().spacing.window_padding, // hack for windows
|
||||||
|
);
|
||||||
|
|
||||||
State {
|
State {
|
||||||
desired_size: default_size,
|
desired_size: default_size,
|
||||||
@@ -266,6 +269,11 @@ impl Resize {
|
|||||||
ui.allocate_space(state.last_content_size);
|
ui.allocate_space(state.last_content_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ui.memory().resize.get(&id).is_none() {
|
||||||
|
// First frame.
|
||||||
|
state.desired_size = state.desired_size.at_least(state.last_content_size);
|
||||||
|
}
|
||||||
|
|
||||||
// ------------------------------
|
// ------------------------------
|
||||||
|
|
||||||
if self.with_stroke && corner_response.is_some() {
|
if self.with_stroke && corner_response.is_some() {
|
||||||
|
|||||||
Reference in New Issue
Block a user