widget=GTK_WIDGET(compass);
size=compass->size;
+#if 1
hsize=size/2;
+#else
+hsize=0;
+#endif
fs=size/42;
BOUND(fs, 1, 16);
gdk_draw_layout(widget->window,
compass->gc_h,
- compass->xoffset+size/2-x/2,
+ compass->xoffset+hsize-x/2,
compass->yoffset+size-y-2, compass->layout);
gdk_draw_arc(widget->window,
compass->gc_h,
FALSE,
- compass->xoffset, compass->yoffset+size/2, size, size, 0, 64 * 180);
+ compass->xoffset, compass->yoffset+hsize, size - fs, size - fs, 0, 64 * 360);
/* Simple arrow for heading */
gdk_draw_line(widget->window,
compass->gc_h,
- compass->xoffset + size / 2 + 3,
+ compass->xoffset + hsize + 3,
compass->yoffset + size - y - 5,
- compass->xoffset + size / 2, compass->yoffset + size / 2 + 5);
+ compass->xoffset + hsize, compass->yoffset + hsize + 5);
gdk_draw_line(widget->window,
compass->gc_h,
- compass->xoffset + size / 2 - 3,
+ compass->xoffset + hsize - 3,
compass->yoffset + size - y - 5,
- compass->xoffset + size / 2, compass->yoffset + size / 2 + 5);
+ compass->xoffset + hsize, compass->yoffset + hsize + 5);
gdk_draw_line(widget->window,
compass->gc_h,
- compass->xoffset + size / 2 - 3,
+ compass->xoffset + hsize - 3,
compass->yoffset + size - y - 5,
- compass->xoffset + size / 2, compass->yoffset + size - y - 8);
+ compass->xoffset + hsize, compass->yoffset + size - y - 8);
gdk_draw_line(widget->window,
compass->gc_h,
- compass->xoffset + size / 2 + 3,
+ compass->xoffset + hsize + 3,
compass->yoffset + size - y - 5,
- compass->xoffset + size / 2, compass->yoffset + size - y - 8);
+ compass->xoffset + hsize, compass->yoffset + size - y - 8);
for (i = 0; i < 5; i++) {
PangoMatrix matrix = PANGO_MATRIX_INIT;
pango_matrix_rotate (&matrix, -(dir-compass->data->heading));
pango_context_set_matrix (compass->context, &matrix);
pango_layout_get_pixel_size(compass->layout, &x, &y);
- x = compass->xoffset + size / 2 + ((size / 2 + 15 + fs) * sinf(tmp)) - x / 2,
- y = compass->yoffset + size - ((size / 2 + 15 + fs) * cosf(tmp)) - y / 2,
+ x = compass->xoffset + hsize + ((hsize + 15 + fs) * sinf(tmp)) - x / 2,
+ y = compass->yoffset + size - ((hsize + 15 + fs) * cosf(tmp)) - y / 2,
gdk_draw_layout(widget->window, compass->gc_h, x, y, compass->layout);
}