HostDisplay: Use surface scale for drawing software cursor

This commit is contained in:
Connor McLaughlin 2020-07-01 00:35:33 +10:00
parent bf08385051
commit f65a50d84b

View file

@ -129,10 +129,9 @@ std::tuple<s32, s32, s32, s32> HostDisplay::CalculateDrawRect(s32 window_width,
std::tuple<s32, s32, s32, s32> HostDisplay::CalculateSoftwareCursorDrawRect() const
{
const u32 cursor_extents_x =
static_cast<u32>(static_cast<float>(m_cursor_texture->GetWidth()) * m_cursor_texture_scale * 0.5f);
const u32 cursor_extents_y =
static_cast<u32>(static_cast<float>(m_cursor_texture->GetHeight()) * m_cursor_texture_scale * 0.5f);
const float scale = m_window_info.surface_scale * m_cursor_texture_scale;
const u32 cursor_extents_x = static_cast<u32>(static_cast<float>(m_cursor_texture->GetWidth()) * scale * 0.5f);
const u32 cursor_extents_y = static_cast<u32>(static_cast<float>(m_cursor_texture->GetHeight()) * scale * 0.5f);
const s32 out_left = m_mouse_position_x - cursor_extents_x;
const s32 out_top = m_mouse_position_y - cursor_extents_y;