1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-26 02:14:22 +00:00

Workaround for some OSX10.11 repaint region coalescing problems

This commit is contained in:
jules 2016-02-23 10:01:57 +00:00
parent 70a3db1cb1
commit 5d23645ca2
2 changed files with 9 additions and 13 deletions

View file

@ -524,7 +524,7 @@ public:
*/
void consolidate()
{
for (int i = 0; i < getNumRectangles() - 1; ++i)
for (int i = 0; i < rects.size() - 1; ++i)
{
RectangleType& r = rects.getReference (i);
const ValueType rx1 = r.getX();

View file

@ -859,18 +859,14 @@ public:
void repaint (const Rectangle<int>& area) override
{
Rectangle<float> r ((float) area.getX(), [view frame].size.height - (float) area.getBottom(),
(float) area.getWidth(), (float) area.getHeight());
if (insideDrawRect || areAnyWindowsInLiveResize())
{
deferredRepaints.add (r);
triggerAsyncUpdate();
}
else
{
[view setNeedsDisplayInRect: makeNSRect (r)];
}
// In 10.11 changes were made to the way the OS handles repaint regions, and it seems that it can
// no longer be trusted to coalesce all the regions, or to even remember them all without losing
// a few when there's a lot of activity.
// As a work around for this, we use a RectangleList to do our own coalescing of regions before
// asynchronously asking the OS to repaint them.
deferredRepaints.add ((float) area.getX(), (float) ([view frame].size.height - area.getBottom()),
(float) area.getWidth(), (float) area.getHeight());
triggerAsyncUpdate();
}
void invokePaint (LowLevelGraphicsContext& context)