mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Fixed AnchorX/Y issue (caused by ef1cf223
)
http://rainmeter.net/forum/viewtopic.php?f=14&t=16798
This commit is contained in:
parent
24bf27d394
commit
cfd525c2fc
@ -2818,18 +2818,19 @@ void MeterWindow::UpdateWindow(int alpha, bool reset, bool canvasBeginDrawCalled
|
|||||||
}
|
}
|
||||||
|
|
||||||
BLENDFUNCTION blendPixelFunction = {AC_SRC_OVER, 0, alpha, AC_SRC_ALPHA};
|
BLENDFUNCTION blendPixelFunction = {AC_SRC_OVER, 0, alpha, AC_SRC_ALPHA};
|
||||||
|
POINT ptWindowScreenPosition = {m_ScreenX, m_ScreenY};
|
||||||
POINT ptSrc = {0, 0};
|
POINT ptSrc = {0, 0};
|
||||||
SIZE szWindow = {m_Canvas->GetW(), m_Canvas->GetH()};
|
SIZE szWindow = {m_Canvas->GetW(), m_Canvas->GetH()};
|
||||||
|
|
||||||
if (!canvasBeginDrawCalled) m_Canvas->BeginDraw();
|
if (!canvasBeginDrawCalled) m_Canvas->BeginDraw();
|
||||||
|
|
||||||
HDC dcMemory = m_Canvas->GetDC();
|
HDC dcMemory = m_Canvas->GetDC();
|
||||||
if (!UpdateLayeredWindow(m_Window, nullptr, nullptr, &szWindow, dcMemory, &ptSrc, 0, &blendPixelFunction, ULW_ALPHA))
|
if (!UpdateLayeredWindow(m_Window, nullptr, &ptWindowScreenPosition, &szWindow, dcMemory, &ptSrc, 0, &blendPixelFunction, ULW_ALPHA))
|
||||||
{
|
{
|
||||||
// Retry after resetting WS_EX_LAYERED flag.
|
// Retry after resetting WS_EX_LAYERED flag.
|
||||||
RemoveWindowExStyle(WS_EX_LAYERED);
|
RemoveWindowExStyle(WS_EX_LAYERED);
|
||||||
AddWindowExStyle(WS_EX_LAYERED);
|
AddWindowExStyle(WS_EX_LAYERED);
|
||||||
UpdateLayeredWindow(m_Window, nullptr, nullptr, &szWindow, dcMemory, &ptSrc, 0, &blendPixelFunction, ULW_ALPHA);
|
UpdateLayeredWindow(m_Window, nullptr, &ptWindowScreenPosition, &szWindow, dcMemory, &ptSrc, 0, &blendPixelFunction, ULW_ALPHA);
|
||||||
}
|
}
|
||||||
m_Canvas->ReleaseDC(dcMemory);
|
m_Canvas->ReleaseDC(dcMemory);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user