Skip Menu |

This queue is for tickets about the Prima CPAN distribution.

Report information
The Basics
Id: 63390
Status: resolved
Priority: 0/
Queue: Prima

People
Owner: Nobody in particular
Requestors: user42 [...] zip.com.au
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: fill_ellipse() filled width when height==1
Date: Sun, 28 Nov 2010 11:36:38 +1100
To: bug-Prima [...] rt.cpan.org
From: Kevin Ryde <user42 [...] zip.com.au>
With recent debian Prima 1.28 the program below asks for a 5x1 filled ellipse, but only 4 pixels are drawn. Output is "q c #000000", "w c #FFFFFF", "qwwwwqq"}; where I expected "qwwwwwq"
use strict; use warnings; use Prima; use Prima::Const; my $d = Prima::Image->create (width => 7, height => 1); $d->begin_paint; $d->color (cl::Black); $d->bar (0,0, 4,0); $d->color (cl::White); $d->fill_ellipse (3,0, 5,1); $d->end_paint; $d->save('/tmp/foo.xpm') or die "Error saving:$@\n"; system "cat /tmp/foo.xpm"; exit 0;
Subject: Re: [rt.cpan.org #63390] fill_ellipse() filled width when height==1
Date: Tue, 30 Nov 2010 10:21:44 +1100
To: bug-Prima [...] rt.cpan.org
From: Kevin Ryde <user42 [...] zip.com.au>
In case it helps, for some of my code I send anything with width<=2 or height<=2 (filled or unfilled) off to the rectangle code instead of worrying what happens to the small stuff. As long as the missed pixel doesn't imply something off by 1 also for the bigger cases of course :-).
Just tested on a more-or-less latest ubuntu, can confirm the bug, but it seems that the bug is on X server side - and moreover, only gets manifested if the ellipse is drawn on an image or a bitmap, but NOT on a window. The question is, what is to be done about it. If the bug is limited only to height==1 on images, then I guess that could be detected at runtime that and an extra pixel drawn. But, judging by your other bug with XFillArc, #63392, there are other problems with small arcs, which I'm not sure we could fix at all. I'd hate to say that these two are Xorg bug, but it seems like it. Also, modern Xorg clients use XRANDR for local display drawing, and I wonder if the bug would manifest itself if a server doesn't support it. Which would complicate matters even more. I think the most reasonable outcome here would be to write a small C program that demonstrates the arc problems, and send it to Xorg devs.
Subject: Re: [rt.cpan.org #63390] fill_ellipse() filled width when height==1
Date: Wed, 01 Dec 2010 07:05:15 +1100
To: bug-Prima [...] rt.cpan.org
From: Kevin Ryde <user42 [...] zip.com.au>
"KARASIK via RT" <bug-Prima@rt.cpan.org> writes: Show quoted text
> > Just tested on a more-or-less latest ubuntu, can confirm the bug, but it > seems that the bug is on X server side - and moreover, only gets > manifested if the ellipse is drawn on an image or a bitmap, but NOT on a > window.
That's a bit strange. (I'd have guessed the other way around, if the window ones went to hardware acceleration that doesn't follow the strict X model ...) Show quoted text
> The question is, what is to be done about it. If the bug is > limited only to height==1 on images, then I guess that could be detected > at runtime that and an extra pixel drawn. But, judging by your other bug > with XFillArc, #63392, there are other problems with small arcs,
I think that one is due to passing 1 too big to XFillArc. Show quoted text
> I'd hate to say that these two are > Xorg bug, but it seems like it.
Maybe it's a feature. Passing h=0 to XDrawArc may interpret line width "tangent to the line" to mean vertical and horizontal only, not a rounded half-circle at each end. If that was so then the "centre on the boundary" rule would correctly exclude the rightmost pixel (or bottommost if vertical). You'd think half-circle ends would be included, but maybe that's not a part of the server anyone has thought about :-). My best idea would still be per other message to treat a filled ellipse of width<=2 or height<=2 as a rectangle. -- The electronic delivery strategy makes it possible to deliver things electronicaly.
Show quoted text
> > The question is, what is to be done about it. If the bug is > > limited only to height==1 on images, then I guess that could be detected > > at runtime that and an extra pixel drawn. But, judging by your other bug > > with XFillArc, #63392, there are other problems with small arcs,
> > I think that one is due to passing 1 too big to XFillArc.
Technically yes, but that doesn't helps solving the problem. If you try to plot ellipse with height=2, 3 etc, then the width is correct, 5 pixels, as expected. The only problem is there with 1 pixel height. But, I think that we can't count on Xorg's consistent behavior here. Show quoted text
> Maybe it's a feature. Passing h=0 to XDrawArc may interpret line width > "tangent to the line" to mean vertical and horizontal only, not a > rounded half-circle at each end. If that was so then the "centre on the > boundary" rule would correctly exclude the rightmost pixel (or > bottommost if vertical).
Doesn't seem like feature to me, because window plotting is correct. Show quoted text
> You'd think half-circle ends would be included, but maybe that's not a > part of the server anyone has thought about :-). My best idea would > still be per other message to treat a filled ellipse of width<=2 or > height<=2 as a rectangle.
That is actually a good suggestion, I like it.
Fixed by falling back to rectangle/bar