-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Console window infinitely expands downwards #21
Comments
I couldn't repro this, but am curious if you are still having the problem. |
Just checked and I am. It seems to only be occurring when the window is on my 4k monitor with 125% scaling, but not the 4k at 200% scaling, so maybe something to do with dpi? |
Hi @cebarks, could you please provide a small code example + steps for reproducing this issue? |
Here's the code. The only thing required to reproduce this is to open this app on a 4k screen with scaling that ends in 25% (mine is set to 125%, but 175% also causes this to happen.) Switching scaling to a multiple of 50% stops it from happening.
|
I had the same issue on a 2k (1440p) monitor with 125% scaling in windows settings. I was able to fix it by editing : Line 545 in fa09da3
from
to
|
@makspll is the above enough to get this fixed? I can prepare a pull request too if with the change highlighted by @Flapperkewiet if that would help. |
I am not sure what the cause of this issue is, but if this change fixes it it might be to do with the way floating point is handled. If you can reproduce the issue and this fix works then I am happy to accept PR's for it although I would love to know why exactly this happens ideally! |
I'm getting this issue too. I believe the problem is that {
// ui.vertical(|ui| {
// let scroll_height = ui.available_height() - 30.0;
ui.with_layout(egui::Layout::bottom_up(egui::Align::Min), |ui| {
// Input
let text_edit = TextEdit::singleline(&mut state.buf)
.desired_width(f32::INFINITY)
.font(egui::TextStyle::Monospace);
let text_edit_response = ui.add(text_edit);
// Separator
ui.separator();
// Scroll area
ScrollArea::vertical()
.auto_shrink([false, false])
.stick_to_bottom(true)
// .max_height(scroll_height)
.show(ui, |ui| { This way you don't need to pre-calculate the pixels for the available height. This also stops the large jump that happens to window size when you go to resize it using the grip on the bottom-right corner. Related talk here. |
When the console key is pressed, and the console window is shown, it constantly expands downwards until it hits the bottom of the window. When it does, it starts expanding from the top until it fills the screen. Once it fills the screen, it starts expanding from the bottom again off screen and never stops. I have about as bare bones of a project as you can have so unsure but doubtful its something unique to my usecase.
The text was updated successfully, but these errors were encountered: