From 8ab8bd733e8906c221e908cebba60c19c0f1cd57 Mon Sep 17 00:00:00 2001 From: jules Date: Tue, 1 Dec 2015 16:01:06 +0000 Subject: [PATCH] Optimisation to the last commit to avoid extra repainting when dragging windows --- .../native/juce_mac_NSViewComponentPeer.mm | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm b/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm index 4a5e36adaa..ba572a8870 100644 --- a/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm +++ b/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm @@ -245,26 +245,21 @@ public: fullScreen = isNowFullScreen; NSRect r = makeNSRect (newBounds); + NSSize oldViewSize = [view frame].size; if (isSharedWindow) { r.origin.y = [[view superview] frame].size.height - (r.origin.y + r.size.height); - - if ([view frame].size.width != r.size.width - || [view frame].size.height != r.size.height) - { - [view setNeedsDisplay: true]; - } - [view setFrame: r]; } else { [window setFrame: [window frameRectForContentRect: flippedScreenRect (r)] display: false]; - - [view setNeedsDisplay: true]; } + + if (oldViewSize.width != r.size.width || oldViewSize.height != r.size.height) + [view setNeedsDisplay: true]; } Rectangle getBounds (const bool global) const