Make comment different

This commit is contained in:
Dean Herbert 2017-07-14 18:08:47 +09:00
parent b1d447bf71
commit b7612af20c
1 changed files with 4 additions and 4 deletions

View File

@ -10,7 +10,7 @@ namespace osu.Game.Graphics.Containers
internal class OsuScrollContainer : ScrollContainer
{
/// <summary>
/// Add the ability to seek to an absolute scroll position when the right mouse button is pressed or dragged.
/// Allows controlling the scroll bar from any position in the container using the right mouse button.
/// Uses the value of <see cref="DistanceDecayOnRightMouseScrollbar"/> to smoothly scroll to the dragged location.
/// </summary>
public bool RightMouseScrollbar = false;
@ -20,7 +20,7 @@ internal class OsuScrollContainer : ScrollContainer
/// </summary>
public double DistanceDecayOnRightMouseScrollbar = 0.02;
private bool shouldPerformRelativeDrag(InputState state) => RightMouseScrollbar && state.Mouse.IsPressed(MouseButton.Right);
private bool shouldPerformRightMouseScroll(InputState state) => RightMouseScrollbar && state.Mouse.IsPressed(MouseButton.Right);
private void scrollToRelative(float value) => ScrollTo(Clamp((value - Scrollbar.DrawSize[ScrollDim] / 2) / Scrollbar.Size[ScrollDim]), true, DistanceDecayOnRightMouseScrollbar);
@ -30,7 +30,7 @@ internal class OsuScrollContainer : ScrollContainer
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args)
{
if (shouldPerformRelativeDrag(state))
if (shouldPerformRightMouseScroll(state))
{
scrollToRelative(state.Mouse.Position[ScrollDim]);
return true;
@ -52,7 +52,7 @@ protected override bool OnDrag(InputState state)
protected override bool OnDragStart(InputState state)
{
if (shouldPerformRelativeDrag(state))
if (shouldPerformRightMouseScroll(state))
{
mouseScrollBarDragging = true;
return true;