Problem with very large scrolled NSViews
Problem with very large scrolled NSViews
- Subject: Problem with very large scrolled NSViews
- From: Andrea at Redmatica <email@hidden>
- Date: Mon, 20 Jun 2005 07:13:46 +0200
I have currently a problem with drawing in a custom NSView in a
NSScrollView which can scroll horizontally.
The NSView bounds can potentially become *very* large (up to 2
billions pixels), and this by itself would not be the problem.
The real problem is that all Cocoa primitive elements (points, rects,
etc) are expressed as floats (24bit of mantissa) and not doubles,
and this means that as soon as the values cross the 16M boundaries
the floats can't address the single pixel anymore.
In detail: when my drawRect: method is invoked, and the origin of the
rect to draw/redraw is at a coordinate more than 16M i can't address
the single pixels anymore, because the floats have not that much
resolution.
As an intuitive solution, after scrolling horizontally, i'd try to
reposition the bounds of my custom NSView so that the the point at
x=0, y=0 remains coincident with the visible portion. In that way the
visible portion of my view would always be in the low digits range.
However, right now i can't figure out how to implement this.
Another solution might be to not use the standard NSScrollView
mechanism and create what i need by myself.
Suggestions? Comments?
Andrea
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden