nanogui: Thread: Arc drawing not working


[<<] [<] Page 1 of 1 [>] [>>]
Subject: Arc drawing not working
From: "Martin Kajdas" ####@####.####
Date: 29 Oct 2007 15:13:05 +0000
Message-Id: <CF2BB830A62F914F848E5AD5FFF57AC24F992D@mkmail.MKPROD.COM>

I have the latest CVS nano-X and nxlib and there is still a problem with
arc drawing.
I have a FLTK program that links with nxlib and runs on nano-X and arc
draw is the only problem now.
For me, it seems that the arcs 174-178 deg and 182-186 are either drawn
as a full circle or not at all (can't remember which is which now).
The same program works fine on X11.
I know that there was a problem with arcs around 180 deg but my arcs are
a few degrees away from 180, and arcs around 180 work fine.
Larger arcs also work fine, it occurs only for small arcs (4-5 degrees)
close to 180 (2-3 deg) but not crossing 180.
Anyone has any ideas where to look or what to do?
Martin
Subject: Re: [nanogui] Arc drawing not working
From: "Greg Haerr" ####@####.####
Date: 13 Nov 2007 00:57:58 +0000
Message-Id: <011b01c82590$2e512f90$6401a8c0@winXP>

> I know that there was a problem with arcs around 180 deg but my arcs are
a few degrees away from 180, and arcs around 180 work fine.
Larger arcs also work fine, it occurs only for small arcs (4-5 degrees)
close to 180 (2-3 deg) but not crossing 180.


I thought I had all the arc routines fixed, but it seems not.  This
code, in engine/devarc.c, probably needs a complete rewrite.

Nonetheless, try setting HIGHPRECISION in that file and see 
whether that fixes your problem.  I think it requires floating
point.  Even if your target doesn't, it would be interesting
to see whether this fixes the problem.

Also look at the FIXME statement in GdArc(), perhaps 
we shouldn't be incrementing ax, ay either...

Regards,

Greg
Subject: RE: [nanogui] Arc drawing not working
From: "Martin Kajdas" ####@####.####
Date: 13 Nov 2007 22:06:47 +0000
Message-Id: <CF2BB830A62F914F848E5AD5FFF57AC24F993B@mkmail.MKPROD.COM>

> Nonetheless, try setting HIGHPRECISION in that file and see whether
that fixes your problem.  I think it requires floating point.
> Even if your target doesn't, it would be interesting to see whether
this fixes the problem.
>
> Also look at the FIXME statement in GdArc(), perhaps we shouldn't be
incrementing ax, ay either...

I tried both suggestions without any difference. The FIXME is not even
executed (false if) so it does not make any difference.

I have a problem with drawing a pie from 182 to 187 degrees. It draws as
a full circle with nxlib. With X11 draws OK.
I traced the calls and this is the log:
drawArc: x=81, y=136, w=267, h=267, a1=182, a2=5, (182,187)
GdArcAngle: x0=214, y0=269, rx=133, ry=133, ax=-132, ay=4, bx=-132,
by=16, angle1=11648, angle2=11968
GdArc: the same

All of the numbers calculate correctly with some truncation from float
to int.
The only thing left to do is to clip and draw and I have no idea why
these numbers would cause the error.
Anyone knows?
Subject: Re: [nanogui] Arc drawing not working
From: "Greg Haerr" ####@####.####
Date: 22 Nov 2007 01:12:51 +0000
Message-Id: <0f3401c82ca4$c47e0130$6401a8c0@winXP>

> I have the latest CVS nano-X and nxlib and there is still a problem with
arc drawing.

I have rewritten the arc drawing and fill routines for GdArcAngle,
after realizing that the current implementation is far too complex
and likely can't be fixed.  This should fix any issues when using
NXLIB, since only GrArcAngle is called.  Also, floating point
is now not required when using this routine.

I had to leave the GdArc implementation in unchanged, I will
update that on a later date.  This only affects programs using
the win32 api currently, as GrArcAngle can be used for
all nano-X programs.

Martin - let me know how this works.  You'll also need the
CVS NXLIB as well.

Regards,

Greg
[<<] [<] Page 1 of 1 [>] [>>]


Powered by ezmlm-browse 0.20.