From f8c9592a431ab7d538b2177dbd333be70fb535fa Mon Sep 17 00:00:00 2001 From: lucasmerlin Date: Mon, 27 May 2024 23:12:59 +0200 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Emil Ernerfeldt --- crates/egui/src/ui.rs | 2 +- crates/egui_demo_lib/src/demo/scrolling.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/egui/src/ui.rs b/crates/egui/src/ui.rs index e34a3ad1cb9..fac5ea2b60d 100644 --- a/crates/egui/src/ui.rs +++ b/crates/egui/src/ui.rs @@ -1073,7 +1073,7 @@ impl Ui { /// A positive Y-value indicates the content is being moved down, /// as when swiping down on a touch-screen or track-pad with natural scrolling. /// - /// If this is called multiple times per frame for the same [`ScrollArea`], the deltas will be combined. + /// If this is called multiple times per frame for the same [`ScrollArea`], the deltas will be summed. /// /// /// See also: [`Response::scroll_to_me`], [`Ui::scroll_to_rect`], [`Ui::scroll_to_cursor`] /// diff --git a/crates/egui_demo_lib/src/demo/scrolling.rs b/crates/egui_demo_lib/src/demo/scrolling.rs index d7bee754c5b..cd9dd13ebf5 100644 --- a/crates/egui_demo_lib/src/demo/scrolling.rs +++ b/crates/egui_demo_lib/src/demo/scrolling.rs @@ -294,7 +294,7 @@ impl super::View for ScrollTo { scroll_top |= ui.button("Scroll to top").clicked(); scroll_bottom |= ui.button("Scroll to bottom").clicked(); if ui.button("Scroll down by 64px").clicked() { - scroll_delta = Some(Vec2::new(0.0, -64.0)); + scroll_delta = Some(64.0 * Vec2::UP); // move contents up } });