1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Fix for openGL rendering engine in native-titlebar windows.

This commit is contained in:
jules 2013-08-01 16:45:37 +01:00
parent ea9e833e5d
commit 41f257053a
2 changed files with 18 additions and 14 deletions

View file

@ -1404,12 +1404,13 @@ private:
static BOOL CALLBACK clipChildWindowCallback (HWND hwnd, LPARAM context)
{
RECT childPos, parentPos;
RECT childPos;
GetWindowRect (hwnd, &childPos);
GetWindowRect (GetParent (hwnd), &parentPos);
POINT pos = { childPos.left, childPos.top };
ScreenToClient (GetParent (hwnd), &pos);
((RectangleList<int>*) context)->subtract (Rectangle<int> (childPos.left - parentPos.left,
childPos.top - parentPos.top,
((RectangleList<int>*) context)->subtract (Rectangle<int> (pos.x,
pos.y,
childPos.right - childPos.left,
childPos.bottom - childPos.top));
return TRUE;

View file

@ -185,18 +185,21 @@ public:
void updateViewportSize (bool canTriggerUpdate)
{
const double newScale = Desktop::getInstance().getDisplays()
.getDisplayContaining (component.getScreenBounds().getCentre()).scale;
Rectangle<int> newArea (component.getLocalBounds() * newScale);
if (scale != newScale || viewportArea != newArea)
if (ComponentPeer* peer = component.getPeer())
{
scale = newScale;
viewportArea = newArea;
Rectangle<int> newArea (peer->getAreaCoveredBy (component).withPosition (0, 0));
if (canTriggerUpdate)
invalidateAll();
const double newScale = Desktop::getInstance().getDisplays()
.getDisplayContaining (component.getScreenBounds().getCentre()).scale;
if (scale != newScale || viewportArea != newArea)
{
scale = newScale;
viewportArea = newArea;
if (canTriggerUpdate)
invalidateAll();
}
}
}