]> err.no Git - mapper/commitdiff
Cleanups
authorKaj-Michael Lang <milang@angel.tal.org>
Tue, 2 Oct 2007 22:24:01 +0000 (01:24 +0300)
committerKaj-Michael Lang <milang@angel.tal.org>
Tue, 2 Oct 2007 22:24:01 +0000 (01:24 +0300)
src/gtkcompass.c
src/gtkgps.c

index 62bf9eecb5bf008f6a5bd443978fd1fa4f1ceb1b..e570140604ce2edb82efd224bb0d4638e2b7b359 100644 (file)
@@ -94,8 +94,6 @@ switch (prop_id) {
 static void
 gtk_compass_init (GtkCompass *compass)
 {
-g_printf("%s()\n", __PRETTY_FUNCTION__);
-
 compass->gc_h=NULL;
 compass->gc_d=NULL;
 compass->gc_w=NULL;
@@ -132,8 +130,6 @@ static void
 gtk_compass_finalize(GObject *object)
 {
 GtkCompass *compass;
-
-g_printf("%s()\n", __PRETTY_FUNCTION__);
        
 g_return_if_fail(GTK_IS_COMPASS(object));
 compass=GTK_COMPASS(object);
@@ -149,8 +145,6 @@ static void
 gtk_compass_size_request(GtkWidget     *widget, GtkRequisition *requisition)
 {
 GtkCompass *compass;
-
-g_printf("%s()\n", __PRETTY_FUNCTION__);
        
 g_return_if_fail(GTK_IS_COMPASS(widget));
 g_return_if_fail(requisition != NULL);
@@ -168,8 +162,6 @@ gtk_compass_size_allocate(GtkWidget *widget, GtkAllocation *allocation)
 {
 GtkCompass *compass;
 
-g_printf("%s()\n", __PRETTY_FUNCTION__);
-
 g_return_if_fail(GTK_IS_COMPASS(widget));
 g_return_if_fail(allocation!=NULL);
 
@@ -205,8 +197,6 @@ GdkColor color;
 GdkWindowAttr attributes;
 gint attributes_mask;
 
-g_printf("%s()\n", __PRETTY_FUNCTION__);
-
 g_return_if_fail (GTK_IS_COMPASS(widget));
 GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
 compass=GTK_COMPASS(widget);
@@ -287,7 +277,7 @@ static void
 gtk_compass_paint(GtkCompass *compass)
 {
 GtkWidget *widget;
-guint i, x, y, size, hsize;
+guint i, x, y, size, hsize, fs;
 gint dir;
 gfloat tmp;
 gchar *text;
@@ -299,6 +289,9 @@ widget=GTK_WIDGET(compass);
 size=compass->size;
 hsize=size/2;
 
+fs=size/42;
+BOUND(fs, 1, 16);
+
 pango_context_set_matrix (compass->context, NULL);
 
 g_snprintf(htext, 8, "%3.0f°", compass->data->heading);
@@ -400,7 +393,7 @@ for (i = 0; i < 5; i++) {
        pango_matrix_rotate (&matrix, dir);
        pango_context_set_matrix (compass->context, &matrix);
 
-       pango_font_description_set_size(compass->fontdesc, (10 + x) * PANGO_SCALE);
+       pango_font_description_set_size(compass->fontdesc, (10 + x + fs) * PANGO_SCALE);
        pango_layout_set_font_description(compass->layout, compass->fontdesc);
        pango_layout_set_text(compass->layout, text, -1);
        pango_layout_get_pixel_size(compass->layout, &x, &y);
@@ -419,7 +412,7 @@ for (i = 0; i < 5; i++) {
        }
 }
 
-return TRUE;
+return;
 }
 
 
@@ -440,11 +433,8 @@ gtk_compass_refresh(GtkWidget *widget)
 {
 GtkCompass *compass;
 
-g_printf("%s()\n", __PRETTY_FUNCTION__);
 g_return_if_fail(GTK_IS_COMPASS(widget));
 
 compass=GTK_COMPASS(widget);
 gtk_compass_paint(compass);
-
-g_printf("%s(): return\n", __PRETTY_FUNCTION__);
 }
index 9923b228b843c0d8ff65776694f6e55f7e380d27..bd0a0e54e9b8ac95ba46c0bb0a93ff7a19460406 100644 (file)
@@ -293,14 +293,14 @@ if (!GTK_WIDGET_MAPPED(widget))
 x0=0;
 y0=0;
 
-size=gps->size;
+size=gps->size-PADDING;
 halfsize=size/2;
 if (gps->width>gps->height) {
-       xoffset=x0+(gps->width-gps->height-PADDING)/2;
+       xoffset=x0+(gps->width-gps->height)/2;
        yoffset=y0+5;
 } else {
        xoffset=x0+5;
-       yoffset=y0+(gps->height-gps->width-PADDING)/2;
+       yoffset=y0+(gps->height-gps->width)/2;
 }
 
 gtk_paint_flat_box (widget->style,