gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fix: NSWindow, setFrameFromString and stringWithSavedFrame


From: Nicola Pero
Subject: Re: Fix: NSWindow, setFrameFromString and stringWithSavedFrame
Date: Thu, 1 Aug 2002 14:11:18 +0100 (BST)

Hi Georg,

I think Richard wrote that code, and looking at the ChangeLog I suspect he
wanted it to save the top-left corner on purpose.  The fact that there are
explicit comments about using flipped coordinates is also suspicious that
there is some real intention in using them.  I just wish Richard had been
a little more verbose in the code :-) [he's away for some weeks at the
moment]

But the only advantage I can see in saving the top-left corner is if you
edit your defaults/window strings by hand.  If you edit your defaults by
hand, then of course saving the top-left corner is better, since you can
then edit by hand the size of a window, and the top-left corner remains
correctly placed (if we save the bottom-left corner, you also have to
manually adjust the window origin when you manually edit the window size).  
Is this the only reason why we save the top-left corner ?  Not a big
issue, compatibility seems more important.

I don't have an openstep system (nor a macosx) to test what actually
happens in other systems - can someone else confirm that we really need to
change the way we convert window frames into strings in order to be
compatible ?

Anyone has any help/comments on this change or can enlighten me on why we
currently save the window frame top-left corner and why changing/not
changing the way we save it ?



> Hi,
> 
> I noticed that GNUstep uses flipped coordinates for the frame string in  
> -setFrameFromString and -stringWithSavedFrame.
> On OpenStep the methods use normal coordinates.
> The attached patch removes the flipping.
> 
> Georg
> 
> 
> 
> 2002-07-28  Georg Fleischmann
>       * gui/Source/NSWindow [-setFrameFromString:], [-stringWithSavedFrame:]:
>       don't flip coordinates to make it compatible with OpenStep
> 
> 
> 
> *** gui/Source/NSWindow.m.old Mon Jul 22 18:38:35 2002
> --- gui/Source/NSWindow.m     Sun Jul 28 22:02:28 2002
> ***************
> *** 3518,3528 ****
>       }
> 
>     /*
> -    * Convert frame from flipped to normal coordinates.
> -    */
> -   fRect.origin.y -= fRect.size.height;
> -
> -   /*
>      * Check and set frame.
>      */
>     if (_maximumSize.width > 0 && fRect.size.width > _maximumSize.width)
> --- 3518,3523 ----
> ***************
> *** 3574,3580 ****
>     NSRect    sRect;
> 
>     fRect = _frame;
> -   fRect.origin.y += fRect.size.height;      /* Make flipped */
>     /*
>      * FIXME - the screen rectangle should give the area of the screen in 
> which
>      * the window could be placed (ie a rectangle excluding the dock), but
> --- 3569,3574 ----
> 
> _______________________________________________
> Bug-gnustep mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/bug-gnustep
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]