C (167/257)

From:
Date:19 Feb 2001 at 02:54:35
Subject:Re: Again clipping graphics output

Czesc Serge!

Dnia 19-Lut-01, Serge Tumanyan napisa�:

>Could you describe this more precisely? The most interesting is
>the fact that, according to my user bug reports, this began to
>happen as soon as I began to use layers library.

And that is why I asked you for working part of source... ;) Without it I
cannot check if you implemented layers correctly...

>AO>>>> The problem in this case is, that I do not know, and can't
>AO>>>> calculate the size of future graphics.
>AO> hmm... I'm quite sceptical here ;-)
>The user draws vector graphics, and can move it on his will. Any
>scepticism left?

Partially... ;) You can "remove" all lines, curves, rectangles, ellipses, text
which are fully invisible and then you'll have a lot less graphics to
render... Things like lines etc. could be easily clipped... For example, if
you must render line from x0,y0 to x1,y1 you could do:

if( ( ( x0 < 0 ) && ( x1 < 0 ) ) || ( ( y0 < 0 ) && ( y1 < 0 ) ) || ( ( x0 >=
width ) && ( x1 >= width ) ) || ( ( y0 >= height ) && ( y1 >= height ) ) )
// line is invisible. don't render.
else if( ( x0 >= 0 ) && ( y0 >= 0 ) && ( x0 < width ) && ( y0 < height ) && (
x1 >= 0 ) && ( y1 >= 0 ) && ( x1 < width ) && ( y1 < height ) )
// line is visible. render without clipping.
else
// line is partially visible. we clip it by hand (it's always faster then
layers.library but it'll become a problem if you would like doing things
which you can do using InstallClipRegion()).

Do you know how to clip graphics by hand?

Regards!



Can your ImageFX paint like bitmap painters?
Download: gfx/ifx/REDFiX.lha, ftp.novadesign.com

Przemyslaw 'SENSEI' Gruchala

code/gfx2d/gfx3d/webmaster

Amiga 1200
Apollo 1240/33 MHz, 18 MB RAM, BTC 33.6 bps
HDD 3.2 GB, HDD 520 MB, CD x12



Prezentacja oferty i sprzedaz produktow Twojej firmy w Centrum e-biznesu
teraz za niecala zlotowke dziennie!
KLIKNIJ I ZAMOW http://www.getin.pl/centrum/es_logon.asp

------------------------ Yahoo! Groups Sponsor ---------------------~-~>
eGroups is now Yahoo! Groups
Click here for more details
http://click.egroups.com/1/11231/0/_/451227/_/982551321/
---------------------------------------------------------------------_->