-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
bugSomething is brokenSomething is broken
Description
Describe the bug
scroll_with_delta doesn't seem to work.
To Reproduce
Steps to reproduce the behavior:
- Create an app with
eframe. - Copy the
scroll_with_deltaexample from documentation. - Click
Scroll downbutton. - See that nothing happens.
use eframe::egui::{self, Vec2};
fn main() -> Result<(), eframe::Error> {
eframe::run_native(
"My egui App",
eframe::NativeOptions::default(),
Box::new(|_cc| Box::new(MyApp {})),
)
}
struct MyApp {}
impl eframe::App for MyApp {
fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {
egui::CentralPanel::default().show(ctx, |ui| {
let mut scroll_delta = Vec2::ZERO;
if ui.button("Scroll down").clicked() {
scroll_delta.y -= 64.0; // move content up
}
egui::ScrollArea::vertical().show(ui, |ui| {
ui.scroll_with_delta(scroll_delta);
for i in 0..1000 {
ui.label(format!("Item {}", i));
}
});
});
}
}Expected behavior
Content scrolls down.
Screenshots
untitled.webm
Desktop (please complete the following information):
- OS: GNU/Linux
YgorSouza and JoshLambda
Metadata
Metadata
Assignees
Labels
bugSomething is brokenSomething is broken