mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-04-26 06:18:32 +00:00
InputCommon: Make "Cursor" inputs aware of the rendered aspect ratio.
This commit is contained in:
parent
42c03c4dad
commit
b92f6480a0
9 changed files with 59 additions and 21 deletions
|
@ -257,6 +257,21 @@ void ControllerInterface::UpdateInput()
|
|||
}
|
||||
}
|
||||
|
||||
void ControllerInterface::SetAspectRatioAdjustment(float value)
|
||||
{
|
||||
m_aspect_ratio_adjustment = value;
|
||||
}
|
||||
|
||||
Common::Vec2 ControllerInterface::GetWindowInputScale() const
|
||||
{
|
||||
const auto ar = m_aspect_ratio_adjustment.load();
|
||||
|
||||
if (ar > 1)
|
||||
return {1.f, ar};
|
||||
else
|
||||
return {1 / ar, 1.f};
|
||||
}
|
||||
|
||||
// Register a callback to be called when a device is added or removed (as from the input backends'
|
||||
// hotplug thread), or when devices are refreshed
|
||||
// Returns a handle for later removing the callback.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue