Browse Source

macOS: Redraw drop-shadow on repaint for transparent NSWindows to fix some drawing artifacts

tags/2021-05-28
ed 5 years ago
parent
commit
8d3fd92784
1 changed files with 8 additions and 3 deletions
  1. +8
    -3
      modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm

+ 8
- 3
modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm View File

@@ -876,13 +876,18 @@ public:
drawRect (cg, rect, displayScale); drawRect (cg, rect, displayScale);
CGContextRestoreGState (cg); CGContextRestoreGState (cg);
} }
return;
} }
} }
else
#endif #endif
{
drawRect (cg, r, displayScale);
}
drawRect (cg, r, displayScale);
// transparent NSWindows with a drop-shadow need to redraw their shadow when the content
// changes to avoid stale shadows being drawn behind the window
if (! isSharedWindow && ! [window isOpaque] && [window hasShadow])
[window invalidateShadow];
} }
void drawRect (CGContextRef cg, NSRect r, float displayScale) void drawRect (CGContextRef cg, NSRect r, float displayScale)


Loading…
Cancel
Save