From 4e316d32e5701ddb343eb2203b6f543340088d56 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Thu, 17 Feb 2022 16:45:42 +0100 Subject: [PATCH] Fix scroll_to with align Broke in https://github.com/emilk/egui/pull/1252 --- egui/src/containers/scroll_area.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/egui/src/containers/scroll_area.rs b/egui/src/containers/scroll_area.rs index 41681d95..e86a435c 100644 --- a/egui/src/containers/scroll_area.rs +++ b/egui/src/containers/scroll_area.rs @@ -507,7 +507,7 @@ impl Prepared { // Depending on the alignment we need to add or subtract the spacing spacing *= remap(center_factor, 0.0..=1.0, -1.0..=1.0); - offset + spacing + offset + spacing - state.offset[d] } else if start < clip_start && end < clip_end { -(clip_start - start + spacing).min(clip_end - end - spacing) } else if end > clip_end && start > clip_start {