mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 04:22:20 +02:00
BeefPerf scroll wheel fixes
This commit is contained in:
parent
72411118c2
commit
1013383202
1 changed files with 4 additions and 4 deletions
|
@ -2025,18 +2025,18 @@ namespace BeefPerf
|
||||||
gApp.SetCursor(wantCursor);
|
gApp.SetCursor(wantCursor);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void MouseWheel(float x, float y, float delta)
|
public override void MouseWheel(float x, float y, float deltaX, float deltaY)
|
||||||
{
|
{
|
||||||
base.MouseWheel(x, y, delta);
|
base.MouseWheel(x, y, deltaX, deltaY);
|
||||||
|
|
||||||
double ticksPerPixel = 1.0 / mTickScale;
|
double ticksPerPixel = 1.0 / mTickScale;
|
||||||
double mouseTick = (x * ticksPerPixel) + mTickOffset;
|
double mouseTick = (x * ticksPerPixel) + mTickOffset;
|
||||||
|
|
||||||
float scaleFactor = (mWidgetWindow.IsKeyDown(.Control)) ? 1.02f : 1.2f;
|
float scaleFactor = (mWidgetWindow.IsKeyDown(.Control)) ? 1.02f : 1.2f;
|
||||||
|
|
||||||
if (delta > 0)
|
if (deltaY > 0)
|
||||||
mTickScale *= scaleFactor;
|
mTickScale *= scaleFactor;
|
||||||
else if (delta < 0)
|
else if (deltaY < 0)
|
||||||
mTickScale /= scaleFactor;
|
mTickScale /= scaleFactor;
|
||||||
|
|
||||||
ClampView(); // Clamp scale first
|
ClampView(); // Clamp scale first
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue