Kaydet (Commit) b9064c07 authored tarafından Miklos Vajna's avatar Miklos Vajna

vcl: fix window vs buffer map mode mismatch in PaintHelper

This avoids painting the first few menu items in really large scale on
the whole window after window resize.

Change-Id: I2469403684b1ae3b93892d49536115df2cef81bc
Reviewed-on: https://gerrit.libreoffice.org/16429Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
Tested-by: 's avatarJenkins <ci@libreoffice.org>
üst f7ed8b99
......@@ -48,6 +48,7 @@ private:
vcl::Region* m_pChildRegion;
Rectangle m_aSelectionRect;
Rectangle m_aPaintRect;
MapMode m_aPaintRectMapMode;
vcl::Region m_aPaintRegion;
sal_uInt16 m_nPaintFlags;
bool m_bPop : 1;
......@@ -117,6 +118,9 @@ void PaintHelper::CreateBuffer()
SetupBuffer();
// Remember what was the map mode of m_aPaintRect.
m_aPaintRectMapMode = m_pWindow->GetMapMode();
// update the output size now, after all the settings were copied
m_pBuffer->SetOutputSize(m_pWindow->GetOutputSize());
......@@ -171,7 +175,15 @@ void PaintHelper::PaintBuffer()
// [ie. everything you can see was painted directly to the
// window either above or in eg. an event handler]
if (!getenv("VCL_DOUBLEBUFFERING_AVOID_PAINT"))
{
// The map mode of m_pWindow and/or m_pBuffer may have changed since
// CreateBuffer(), set it back to what it was, otherwise unwanted
// scaling or translating may happen.
m_pWindow->SetMapMode(m_aPaintRectMapMode);
m_pBuffer->SetMapMode(m_aPaintRectMapMode);
m_pWindow->DrawOutDev(m_aPaintRect.TopLeft(), m_aPaintRect.GetSize(), m_aPaintRect.TopLeft(), m_aPaintRect.GetSize(), *m_pBuffer.get());
}
}
void PaintHelper::DoPaint(const vcl::Region* pRegion)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment