}
static void
-gtk_compass_draw_mark(GtkCompass *compass, GdkGC *gc, gdouble angle, gint size)
+gtk_compass_draw_mark(GtkCompass *compass, GdkGC *gc, gfloat angle, gint size)
{
GtkWidget *widget;
gint hs;
hs=compass->size/2;
gdk_draw_line(widget->window,gc,
- compass->xoffset+hs+((hs-size)*sin(angle)),
- compass->yoffset+compass->size-((hs-size)*cos(angle)),
- compass->xoffset+hs+((hs+size)*sin(angle)),
- compass->yoffset+compass->size-((hs+size)*cos(angle)));
+ compass->xoffset+hs+((hs-size)*sinf(angle)),
+ compass->yoffset+compass->size-((hs-size)*cosf(angle)),
+ compass->xoffset+hs+((hs+size)*sinf(angle)),
+ compass->yoffset+compass->size-((hs+size)*cosf(angle)));
}
static void
gdk_draw_layout(widget->window, compass->gc_h, x, y, compass->layout);
}
-if (compass->dest_valid)
- gtk_compass_draw_mark(compass, compass->gc_d, compass->dest_heading, 10);
+if (compass->dest_valid) {
+ tmp=((compass->dest_heading-compass->data->heading) * (1.f / 180.f)) * G_PI;
+ gtk_compass_draw_mark(compass, compass->gc_d, tmp, 10);
+}
-if (compass->way_valid)
- gtk_compass_draw_mark(compass, compass->gc_w, compass->way_heading, 10);
+if (compass->way_valid) {
+ tmp=((compass->way_heading-compass->data->heading) * (1.f / 180.f)) * G_PI;
+ gtk_compass_draw_mark(compass, compass->gc_w, tmp, 10);
+}
return;
}