diff --git a/osu.Framework/Graphics/Containers/ScrollContainer.cs b/osu.Framework/Graphics/Containers/ScrollContainer.cs index eae4c968ee..e838aa683f 100644 --- a/osu.Framework/Graphics/Containers/ScrollContainer.cs +++ b/osu.Framework/Graphics/Containers/ScrollContainer.cs @@ -409,7 +409,7 @@ protected override bool OnScroll(ScrollEvent e) return true; } - private void onScrollbarMovement(float value) => OnUserScroll(Clamp(fromScrollbarPosition(value)), false); + private void onScrollbarMovement(float value) => OnUserScroll(Clamp(FromScrollbarPosition(value)), false); /// /// Immediately offsets the current and target scroll position. @@ -576,12 +576,12 @@ protected override void UpdateAfterChildren() if (ScrollDirection == Direction.Horizontal) { - Scrollbar.X = toScrollbarPosition(Current); + Scrollbar.X = ToScrollbarPosition(Current); ScrollContent.X = -Current + ScrollableExtent * ScrollContent.RelativeAnchorPosition.X; } else { - Scrollbar.Y = toScrollbarPosition(Current); + Scrollbar.Y = ToScrollbarPosition(Current); ScrollContent.Y = -Current + ScrollableExtent * ScrollContent.RelativeAnchorPosition.Y; } } @@ -591,7 +591,7 @@ protected override void UpdateAfterChildren() /// /// The absolute scroll position (e.g. ). /// The scrollbar position. - private float toScrollbarPosition(float scrollPosition) + protected virtual float ToScrollbarPosition(float scrollPosition) { if (Precision.AlmostEquals(0, ScrollableExtent)) return 0; @@ -604,7 +604,7 @@ private float toScrollbarPosition(float scrollPosition) /// /// The scrollbar position. /// The absolute scroll position. - private float fromScrollbarPosition(float scrollbarPosition) + protected virtual float FromScrollbarPosition(float scrollbarPosition) { if (Precision.AlmostEquals(0, ScrollbarMovementExtent)) return 0;