Re: Problems with x-, y-coordinates > 8388307



On Thu, 2008-10-09 at 20:00 +0100, Damon Chaplin wrote:
> On Thu, 2008-10-09 at 20:09 +0200, Joachim Geyer wrote:
> > Hi all,
> > 
> > i like to use high coordinate-values (like x(y)-center), but for
> > ellipses and lines, coordinates greater than  8388307 do not work for
> > me. I have extended the simple-demo.c example to demonstrate the
> > problem. If I set the variable "shft" to 8388307.0, I get the
> > rectangle, the circle and the text. But with 8388308.0 the circle
> > vanishes.
> 
> Yes, I can reproduce it. Though it is worse for me - the problem starts
> when shft is 32500 here.
> 
> It looks like problems with cairo's fixed-point calculations - cairo
> uses 24.8 fixed point arithmetic internally so values over +/-2^23 can
> cause problems (cairo used to use 16.16, which explains why the problem
> happens at ~2^15 for me.)
> 
> I added code to GooCanvas to try to work around these limits, but it
> looks like it isn't working in this case. I'm not sure where the problem
> lies yet.

I've just remembered - this isn't actually a bug in GooCanvas, it is the
intended behaviour.

The special code I added to GooCanvas allows you to use transformations
that extend past the 24.8 or 16.16 cairo limit. However, all user space
coordinates (i.e. the x & y coordinates) must be within the cairo
limits.

It is possible to write items that can extend past these limits but you
need to be careful whenever you use cairo. (e.g. see the large items
demo.)

Damon




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