bug-gnustep
[Top][All Lists]
Advanced

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

Re: NSCell drawInterior... positioning bug?


From: Richard Frith-Macdonald
Subject: Re: NSCell drawInterior... positioning bug?
Date: Mon, 17 Feb 2003 11:14:07 +0000


On Monday, February 17, 2003, at 10:39  am, Wim Oudshoorn wrote:

However, the above seems to imply that there is no
efficient way of drawing images.  Because either you
draw the complete image, or you do not draw the image.

I think that's currently the case. NSImage provides some
compositeToPoint:fromRect: ... methods, but I don't think the
fromRect argument is properly supported yet, so the entire
image gets drawn.

Probably it is the job of the Graphics context to
avoid unnecessary work.  Well, I leave that for later.

Anyway, perhaps the best thing for XGDragView to do would be
to composite the image itself and set clipping rectangle as needed,
rather than asking an NSCell to do the job.

That defeats the purpose of NSImageCell doesn't it?
Or do I misunderstand the use of NSImageCell all together?

NSImageCell is supposed to handle resizing of the image to fit the rect
(not what you want here), or aligning the image to the rect and
cropping it (don't know if it does the cropping) ... which might be
what is wanted assuming that the rect used by the drag view is always
aligned to two sides of the image.

However, if the rect you are trying to draw covers an arbitrary portion
of the image, I suspect that your simplest option is to set a clipping
rectangle to that rect and just composite the image over it.





reply via email to

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