mirror of
https://github.com/ppy/osu.git
synced 2024-11-15 14:37:30 +08:00
Fix weird mouse position handling and don't return true
to event
This commit is contained in:
parent
b5cc45bdda
commit
6e4eed657c
@ -35,13 +35,13 @@ namespace osu.Game.Screens.Play.HUD
|
||||
|
||||
private double trackTime => (EndTime - StartTime) * Progress;
|
||||
|
||||
private float relativePositionX;
|
||||
private float lastMouseX;
|
||||
|
||||
public LocalisableString TooltipText
|
||||
{
|
||||
get
|
||||
{
|
||||
double progress = Math.Clamp(relativePositionX, 0, DrawWidth) / DrawWidth;
|
||||
double progress = Math.Clamp(lastMouseX, 0, DrawWidth) / DrawWidth;
|
||||
|
||||
TimeSpan currentSpan = TimeSpan.FromMilliseconds(Math.Round((EndTime - StartTime) * progress));
|
||||
|
||||
@ -107,10 +107,8 @@ namespace osu.Game.Screens.Play.HUD
|
||||
{
|
||||
base.OnMouseMove(e);
|
||||
|
||||
var cursorPosition = e.ScreenSpaceMousePosition;
|
||||
relativePositionX = ToLocalSpace(cursorPosition).X;
|
||||
|
||||
return true;
|
||||
lastMouseX = e.MousePosition.X;
|
||||
return false;
|
||||
}
|
||||
|
||||
protected override bool OnHover(HoverEvent e)
|
||||
|
Loading…
Reference in New Issue
Block a user