Re: converting rects between coordinate systems
Re: converting rects between coordinate systems
- Subject: Re: converting rects between coordinate systems
- From: j o a r <email@hidden>
- Date: Thu, 5 Jun 2003 07:45:31 +0200
I still don't get it, but I'm probably just being a bit dense...
Are you looking for how much a subview is scaled? Shouldn't that be
([mySuperview frame].size.width / [mySuperview bounds].size.width)? At
least provided that you "force" subviews to scale with the bounds of
the superview, ie. that the subview is set to [mySubview
setAutoresizingMask: (NSViewWidthSizable | NSViewHeightSizable)] before
the bounds rectangle is scaled differently from the frame rectangle.
Or are you just looking for the width of a subview (you say "the width
of these scaled images in screen pixels")? The sizes of the view frames
are always in screen pixels, right? Should that not be the width of the
frame of the subview?
It seems that you're looking for the width of a subview that is exposed
through the hole that is the frame of the superview (you say "the final
image may only be 200 pixels wide")? But in that case that should just
be the width of the frame of the superview? It should also be a static
size - at least as long as the width of the superview / window doesn't
change?
But perhaps you also want to take into account that the subview might
only expose a corner of it's frame through the hole in the frame of
it's superview (do your subviews always fill the size of the bounds of
their superview?)? In this case you can ask the subview for it's
"visibleRect" and get the width from that.
j o a r
On Thursday, Jun 5, 2003, at 03:45 Europe/Stockholm,
email@hidden wrote:
I have several views that represent huge objects. You would laugh at
the size and location of their frames. In order to show them entirely
on screen, they are placed inside of another view which has an
extremely large bounds rectangle (set with scaleUnitSquareToSize:).
The result is a scaling of the images of the subviews. It is important
for a certain part of the program to calculate the width of these
scaled images in screen pixels. In other words, though the frame of a
subview is extremely large, the final image may only be 200 pixels
wide. That final result is what I seek. I hope this explains the
predicament a bit more.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.