Rev 6 | Rev 9 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6 | Rev 7 | ||
---|---|---|---|
Line 22... | Line 22... | ||
22 | 22 | ||
23 | int si = ap_sin (ang); |
23 | int si = ap_sin (ang); |
24 | int co = ap_cos (ang); |
24 | int co = ap_cos (ang); |
25 | 25 | ||
26 | /* calculate a shift for a second side of the needle */ |
26 | /* calculate a shift for a second side of the needle */ |
27 | int xs = ap_sin (ang - 90); |
27 | int xl = ap_sin (ang - 90); |
28 | int ys = ap_cos (ang - 90); |
28 | int yl = ap_cos (ang - 90); |
29 | 29 | ||
30 | int si2 = siz + 2; |
30 | int si2 = siz + 2; |
31 | int si3 = siz / 2; |
31 | int si3 = 2 * siz / 3; |
32 | 32 | ||
- | 33 | int xs,ys; |
|
- | 34 | // three parallel lines |
|
- | 35 | xs = -xl; |
|
- | 36 | ys = -yl; |
|
- | 37 | int step; |
|
- | 38 | for(step =0; step < 3; step++) |
|
- | 39 | { |
|
33 | drawLine (AP_SCALE(si*si2-xs) + xo, yo - AP_SCALE(co * si2 - ys), |
40 | drawLine (AP_SCALE(si*si2-xs) + xo, yo - AP_SCALE(co * si2 - ys), |
34 | 41 | ||
35 | AP_SCALE(si*si3-xs) + xo, |
42 | AP_SCALE(si*si3-xs) + xo, |
36 | yo - AP_SCALE(co * si3 - ys), INVERT); |
43 | yo - AP_SCALE(co * si3 - ys), INVERT); |
37 | drawLine (AP_SCALE(si*si2+xs) + xo, yo - AP_SCALE(co * si2 + ys), |
- | |
38 | - | ||
39 | AP_SCALE(si*si3+xs) + xo, |
44 | xs+=xl; |
40 | yo - AP_SCALE(co * si3 + ys), INVERT); |
45 | ys+=yl; |
41 | 46 | } |
|
42 | } |
47 | } |
43 | 48 | ||
44 | /* initialise */ |
49 | /* initialise */ |
45 | void |
50 | void |
46 | dial_size (uint8_t size) |
51 | dial_size (uint8_t size) |
47 | { |
52 | { |