Re: of gtk_scrolled_window's viewports and clipping

On Mon, 2003-08-25 at 04:51, Alexander Larsson wrote:
> On Mon, 2003-08-25 at 00:47, Dr. David Alan Gilbert wrote:
> > Hi,
> >   If I have a gtk_drawing_area stuffed inside a gtk_scrolled_window
> > (using gtk_scrolled_window_add_with_viewport) what are the limits
> > on the size of the scrollable region?
> > 
> > And lets say I have a scrollable region of 10M pixels and I've got
> > a 1000 pixel wide window looking at it; their is a line in my
> > doucment that is the entire width of the widget (i.e. 10M pixels).
> > 
> > Will Gdk/Gtk/Gnome cope with me trying to draw that or are there
> > any limits imposed by them or the underlying windowing
> > system even though I'm only actually drawing 1000 pixels on the
> > real display?
> > 
> > Dave
> > 
> > P.S. This question was actually prompted by a 'be careful' note
> > in the Qt docs telling you to clip things to sensible ranges
> > (like 4000ish pixels) in the app before asking for them to
> > be rendered and since I'm writing an app for both KDE and Gnome
> > I wondered if there were similar issues.
> X has a limit of 16 bit window coordinates, however gtk 2.x works around
> this with a technique called "guffaw scrolling", so this should not
> cause any problems.

Note that this applies mostly to window coordinates and there are
still restrictions on drawing text and primitives - text has a limit
of ~4M pixels in extent, other primitives typically inherit the 64k
limits of X (32k is safer due to signed/unsigned issues) 

You should also try to avoid drawing primitives that don't intersect
the visible area at all even if they are small in extent - if you 
draw a circle that's 64k off the left side of the window, it may show
up in the window.

And pixmaps are limited in size to 64k x 64k.

Exact limits will be different on different windowing systems (Win32,
Framebuffer, etc.)

Generally, larger scrolling areas have lots of small graphics primitives
rather than a few *huge* graphics primitives, so these limits don't
matter much.


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