1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-25 18:30:21 +00:00

Now honours permitted mouse range.

This commit is contained in:
Thomas Harte 2020-01-01 12:48:38 -05:00
parent 153f60735d
commit 017681a97c
2 changed files with 5 additions and 1 deletions

View File

@ -72,6 +72,10 @@ void IntelligentKeyboard::run_for(HalfCycles duration) {
mouse_position_[0] += scaled_movement[0];
mouse_position_[1] += mouse_y_multiplier_ * scaled_movement[1];
// Clamp to range.
mouse_position_[0] = std::min(std::max(mouse_position_[0], 0), mouse_range_[0]);
mouse_position_[1] = std::min(std::max(mouse_position_[1], 0), mouse_range_[1]);
mouse_movement_[0] -= scaled_movement[0] * mouse_scale_[0];
mouse_movement_[1] -= scaled_movement[1] * mouse_scale_[1];
} break;

View File

@ -67,7 +67,7 @@
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
enableASanStackUseAfterReturn = "YES"