aboutsummaryrefslogtreecommitdiff
path: root/signpost.c
diff options
context:
space:
mode:
authorFranklin Wei <me@fwei.tk>2017-07-13 16:54:00 -0400
committerFranklin Wei <franklin@rockbox.org>2024-08-08 23:16:29 -0400
commitee5e3270efa37aeb78ecd9f81af800cfb4894d90 (patch)
tree8388f65def6f20eee27f3f025feff79be65d6cc4 /signpost.c
parentbeb0345017f2b083947d18f164c4dd8c4a521dbf (diff)
downloadpuzzles-rockbox-devel.zip
puzzles-rockbox-devel.tar.gz
puzzles-rockbox-devel.tar.bz2
puzzles-rockbox-devel.tar.xz
Signpost: fix star drawing on rockboxrockbox-devel
Diffstat (limited to 'signpost.c')
-rw-r--r--signpost.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/signpost.c b/signpost.c
index 9aed67b..4d2f584 100644
--- a/signpost.c
+++ b/signpost.c
@@ -1895,8 +1895,9 @@ static void draw_star(drawing *dr, int cx, int cy, int rad, int npoints,
coords = snewn(npoints * 2 * 2, int);
for (n = 0; n < npoints * 2; n++) {
- a = 2.0 * PI * ((double)n / ((double)npoints * 2.0)) + angle_offset;
- r = (n % 2) ? (double)rad/2.0 : (double)rad;
+ /* hack to accomodate rockbox's concave polygon drawing */
+ a = 2.0 * PI * ((double)n / ((double)npoints * 2.0)) + angle_offset - PI / npoints;
+ r = (n % 2 == 0) ? (double)rad/2.0 : (double)rad;
/* We're rotating the point at (0, -r) by a degrees */
coords[2*n+0] = cx + (int)( r * sin(a));