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:
parent
ea9e833e5d
commit
41f257053a
2 changed files with 18 additions and 14 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue