Re: avoiding drawing tiny objects in foocanvas





Jody Goldberg wrote:
On Wed, May 12, 2004 at 04:26:00PM +0100, Rob Clack wrote:

I'm drawing tens of thousands of rectangles, using foocanvas to (successfully - thanks Jody!) speed things up, but when zooming out I would like there to come a time when rectangles too small to be correctly rendered are not drawn at all.

At present there seems to be a minimum size beyond which they don't shrink, so eventually they all merge into each other. It's as though the code says "OK, this is as small as this one gets" and keeps drawing it that size, whatever the zoom factor. I want it to say "This one's too small to bother with, so I won't draw it at all"

I accept I'm going to have to hack the foocanvas source code, but so far can't find where it is that this decision is being made.

Anyone know where I should be looking?


libfoocanvas/foo-canvas-rect-ellipse.c : foo_canvas_rect_draw
Throw in some tests to see whether it is useful to draw something
small, or even if it is useful to draw the inside of something
overlapped by it's outline

My apologies for asking the wrong question and this post includes both the right question and what I think is the right answer, just to tie up the loose thread.

What I wanted to know was how to hide objects that were too small to be worth drawing, but still have them appear when you zoomed in far enough.

In foo-canvas-rect-ellipse.c I put a test into foo_canvas_rect_update() to determine whether or not I wanted the rectangle visible, then used
foo_canvas_item_hide() and foo_canvas_item_show() as appropriate.

Thank you Jody for yet more help!
Rob
--
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Weather forecasting: just horoscopes with numbers
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Rob Clack                        Acedb Development,  Informatics Group
 email: rnc sanger ac uk                Wellcome Trust Sanger Institute
 Tel: +44 1223 494883                   Wellcome Trust Genome Campus
 Fax: +44 1223 494919                   Hinxton  Cambridge    CB10 1SA



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