mirror of
https://github.com/fltk/fltk.git
synced 2026-06-06 08:32:07 +08:00
Removed an NSAutoreleasePool allocation/release.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8561 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
+3
-6
@@ -1386,14 +1386,11 @@ void fl_close_display() {
|
||||
|
||||
// Gets the border sizes and the titlebar size
|
||||
static void get_window_frame_sizes(int &bx, int &by, int &bt) {
|
||||
NSAutoreleasePool *localPool;
|
||||
localPool = [[NSAutoreleasePool alloc] init];
|
||||
NSRect inside = { {20,20}, {100,100} };
|
||||
NSRect outside = [NSWindow frameRectForContentRect:inside styleMask:NSTitledWindowMask];
|
||||
bx = int(outside.origin.x - inside.origin.x);
|
||||
by = int(outside.origin.y - inside.origin.y);
|
||||
bt = int(outside.size.height - inside.size.height - by);
|
||||
[localPool release];
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2172,9 +2169,6 @@ void Fl_Window::show() {
|
||||
* resize a window
|
||||
*/
|
||||
void Fl_Window::resize(int X,int Y,int W,int H) {
|
||||
int bx, by, bt;
|
||||
if ( ! this->border() ) bt = 0;
|
||||
else get_window_frame_sizes(bx, by, bt);
|
||||
if (W<=0) W = 1; // OS X does not like zero width windows
|
||||
if (H<=0) H = 1;
|
||||
int is_a_resize = (W != w() || H != h());
|
||||
@@ -2193,6 +2187,9 @@ void Fl_Window::resize(int X,int Y,int W,int H) {
|
||||
} else {
|
||||
size_range(W, H, W, H);
|
||||
}
|
||||
int bx, by, bt;
|
||||
if ( ! this->border() ) bt = 0;
|
||||
else get_window_frame_sizes(bx, by, bt);
|
||||
NSRect dim;
|
||||
dim.origin.x = X;
|
||||
dim.origin.y = [[(NSWindow*)i->xid screen] frame].size.height - (Y + H);
|
||||
|
||||
Reference in New Issue
Block a user