mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
PainterExamples: DrawArc
git-svn-id: svn://ultimatepp.org/upp/trunk@1458 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
8c0aac8241
commit
7c92f7bddc
1 changed files with 4 additions and 4 deletions
|
|
@ -3,13 +3,13 @@
|
|||
void DrawArc(Painter& sw)
|
||||
{
|
||||
Pointf center(350, 300);
|
||||
for(int i = 0; i < 12; i++) {
|
||||
for(int i = 0; i < 13; i++) {
|
||||
double angle = (i - 3) * M_PI / 6;
|
||||
Pointf box_center = Polar(center, 250, angle);
|
||||
Size radius(60, 20);
|
||||
Rect box(Point(box_center), Size(1, 1));
|
||||
box.Inflate(radius);
|
||||
// sw.DrawRect(box, Yellow());
|
||||
sw.DrawRect(box, Yellow());
|
||||
for(int j = 0; j < 12; j++) {
|
||||
double ang2 = j * M_PI / 6;
|
||||
Sizef hand = Polar(Pointf(0, 0), 1, ang2);
|
||||
|
|
@ -18,10 +18,10 @@ void DrawArc(Painter& sw)
|
|||
sw.DrawLine(h1, h2, 1, LtBlue());
|
||||
}
|
||||
Sizef hand = Polar(Pointf(0, 0), 1, angle);
|
||||
sw.DrawArc(box, Point(box_center + radius * hand), box.TopCenter(), 0, LtRed());
|
||||
sw.DrawArc(box, Point(box_center + radius * hand), box.TopCenter(), PEN_DASHDOT, LtRed());
|
||||
}
|
||||
}
|
||||
|
||||
INITBLOCK {
|
||||
RegisterExample("DrawArc", DrawArc);
|
||||
RegisterExample("Draw::DrawArc", DrawArc);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue