Opened 8 months ago

Last modified 8 months ago

#18584 new bug

Problem with StrokeArc

Reported by: thaflo Owned by: stippi
Priority: normal Milestone: Unscheduled
Component: User Interface Version: R1/beta4
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

As I am trying to draw a cake-like thing, I encountered the problem, that the cake-pieces (StrokeArc) don't fit together. Code's like this, picture is attached.Don't know if it's my code fault or what else. In DiskUsage it seems to work.

				backgr->SetPenSize(200);
				backgr->StrokeArc(p, 100, 100, 0, 18);
				backgr->SetHighColor(200,0,0);	
				backgr->StrokeArc(p, 100, 100, 18, 18);
				backgr->SetHighColor(200,200,200);			
				backgr->StrokeArc(p, 100, 100, 36, 18);
				backgr->SetHighColor(0,200,0);			
				backgr->StrokeArc(p, 100, 100, 54, 18);
				
				backgr->SetPenSize(20);
				backgr->FillArc(p,40,40, 0,360);
				backgr->SetHighColor(255,0,0);			
				backgr->FillArc(p,20,20, 0,360);

Attachments (2)

Harts.zip (5.9 KB ) - added by thaflo 8 months ago.
Arc.png (42.0 KB ) - added by thaflo 8 months ago.

Download all attachments as: .zip

Change History (6)

comment:1 by pulkomandy, 8 months ago

Your screenshot does not seem to match at all with your code excerpt: not only the angles are wrong, but also the colors and pen widths? Is it from a different test? Or is that really broken too?

comment:2 by thaflo, 8 months ago

Maybe I (as a beginner) did something wrong. At least I don't get the result I am expecting. I attach the whole code I have. Click the 3th button to draw the thing

Last edited 8 months ago by thaflo (previous) (diff)

by thaflo, 8 months ago

Attachment: Harts.zip added

comment:3 by madmax, 8 months ago

The screenshot and the code still don't match, but I see what you mean.

At a quick glance, we first turn arcs into Bézier curves, which can't really represent them exactly. Whatever immeasurable imprecision for a 1-pixel path is multiplied the farther you go from the middle line, so it would be noticeable with your pen size.

Not sure if that's all, though.

comment:4 by thaflo, 8 months ago

updated attachment - Would be great to know if that behaviou is right or if there is really a problem with designing arcs

Last edited 8 months ago by thaflo (previous) (diff)

by thaflo, 8 months ago

Attachment: Arc.png added
Note: See TracTickets for help on using tickets.