mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Fixed hittest of Button meter due to lack of compatibility with new "Padding" option
This commit is contained in:
parent
369f8c7082
commit
5f1d1c5888
@ -228,14 +228,22 @@ bool MeterButton::HitTest2(int px, int py)
|
||||
|
||||
// Check transparent pixels
|
||||
if (m_Image.IsLoaded())
|
||||
{
|
||||
Rect meterRect = GetMeterRectPadding();
|
||||
int ix = meterRect.Width * m_State;
|
||||
px = px - meterRect.X + ix;
|
||||
py = py - meterRect.Y;
|
||||
if (px >= ix && px < ix + meterRect.Width &&
|
||||
py >= 0 && py < meterRect.Height)
|
||||
{
|
||||
Color color;
|
||||
Status status = m_Image.GetImage()->GetPixel(px - x + m_W * m_State, py - y, &color);
|
||||
Status status = m_Image.GetImage()->GetPixel(px, py, &color);
|
||||
if (status != Ok || color.GetA() != 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user