discuss-gnustep
[Top][All Lists]
Advanced

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

Re: scaling, rotating, flipping subview


From: Fred Kiefer
Subject: Re: scaling, rotating, flipping subview
Date: Sun, 8 Dec 2019 23:04:56 +0100

Nikolaus,

I don’t understand  your question. From your description I would expect that 
NSView already supports all you need but the NSScrollView could not handle it. 
So what you are looking for would be a better scroll view.
I remember the time we worked together to understand the concepts behind view 
transformations. You decided that myStep could work with a simpler model than 
the one required by Cocoa, but the Cocoa one, which I tried to implement in 
GNUstep, should be sufficient to provide the drawing for your CAD view.

Cheers,
Fred

> Am 08.12.2019 um 20:17 schrieb H. Nikolaus Schaller <hns@goldelico.com>:
> 
> Hi,
> I am currently working on some CAD tool for GNUstep/mySTEP
> and for that I would need a NSView class that can become
> the documentView of a NSClipView, embedded in some
> NSScrollView. And the view class I am looking for should
> allow to rotate, flip and scale a subview (where I do the
> drawing).
> 
> There is no standard class which can do that in Cocoa or OpenSTEP.
> 
> I have experimented a little on Cocoa and got scaling work
> (by setting the bounds of the drawing view scaled relative to
> its frame) but flipping and rotation is difficult to achieve.
> 
> It partially works with setBoundsRotation or scaleUnitSquareToSize,
> but as a side-effect that breaks operation of the scrollers of
> the NSScrollView.
> 
> Scroller size and position seems to assume that the frame and
> bounds are not rotated so that changing the bounds origin can
> simply move around the view under the NSClipView.
> 
> The standard recommendation is to set a transform matrix in
> drawRect: and by that I could make drawing work, but coordinate
> transforms for mouse clicks do not take this into account.
> And scrollers do not adjust for different scaling.
> 
> Finally, this is not a general approach which can rotate,
> flip and scale an arbitrary subview.
> 
> Before I invest more time in this topic, I'd like to ask
> if someone knows an open source implementation of such a
> general NSView subclass.
> 
> Thanks,
> Nikolaus
> 
> 




reply via email to

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