1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:07:45 +00:00

WindowServer: Apply the backing bitmap's scale when alpha hit-testing

Fixes #5390
This commit is contained in:
Tom 2021-02-17 16:12:05 -07:00 committed by Andreas Kling
parent b55c9f6bba
commit 6af4d35e8e
2 changed files with 6 additions and 5 deletions

View file

@ -916,7 +916,8 @@ bool Window::hit_test(const Gfx::IntPoint& point, bool include_frame) const
u8 threshold = alpha_hit_threshold() * 255;
if (threshold == 0 || !m_backing_store || !m_backing_store->has_alpha_channel())
return true;
auto color = m_backing_store->get_pixel(point.translated(-rect().location()));
auto relative_point = point.translated(-rect().location()) * m_backing_store->scale();
auto color = m_backing_store->get_pixel(relative_point);
return color.alpha() >= threshold;
}