From 960eedb920a6bd5849c782eb87038cf2eec3cf64 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 27 Jul 2014 00:36:25 +0000 Subject: [PATCH] No real changes, just a micro optimization in wxOSX DoGetAsBitmap(). Don't call wxWindow::GetSize() unnecessarily when we use the given fixed rectangle anyhow. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76957 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/osx/cocoa/utils.mm | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/osx/cocoa/utils.mm b/src/osx/cocoa/utils.mm index 61990badcc..18f3097a6c 100644 --- a/src/osx/cocoa/utils.mm +++ b/src/osx/cocoa/utils.mm @@ -594,12 +594,7 @@ wxBitmap wxWindowDCImpl::DoGetAsBitmap(const wxRect *subrect) const if (!m_window) return wxNullBitmap; - wxSize sz = m_window->GetSize(); - - int width = subrect != NULL ? subrect->width : sz.x; - int height = subrect != NULL ? subrect->height : sz.y ; - - wxBitmap bitmap(width, height); + wxBitmap bitmap(subrect ? subrect->GetSize() : m_window->GetSize()); NSView* view = (NSView*) m_window->GetHandle(); if ( [view isHiddenOrHasHiddenAncestor] == NO )