rem: snprintf(screen.statusbar.diststr, MAX_DISTLEN, " dist,dX,dY (%7.1f, %7.1f, %7.1f)mils (%7.2f, %7.2f, %7.2f)mm", COORD2MILS(delta), COORD2MILS(dx), COORD2MILS(dy), COORD2MMS(delta), COORD2MMS(dx), COORD2MMS(dy));
add: if (screen.unit == GERBV_MILS) { snprintf(screen.statusbar.diststr, MAX_DISTLEN, " dist,dX,dY (%7.1f, %7.1f, %7.1f)mils", COORD2MILS(delta), COORD2MILS(dx), COORD2MILS(dy)); } else  { snprintf(screen.statusbar.diststr, MAX_DISTLEN, " dist,dX,dY (%7.2f, %7.2f, %7.2f)mm", COORD2MMS(delta), COORD2MMS(dx), COORD2MMS(dy)); }
context: draw_measure_distance(){    GdkGC *gc;    GdkGCValues values;    GdkGCValuesMask values_mask;    gint x1, y1, x2, y2;    GdkFont *font;    if (screen.state != MEASURE)	return;    memset(&values, 0, sizeof(values));    values.function = GDK_XOR;    values.foreground = *screen.dist_measure_color;    values_mask = GDK_GC_FUNCTION | GDK_GC_FOREGROUND;    gc = gdk_gc_new_with_values(screen.drawing_area->window, &values,				values_mask);    font = gdk_font_load(GERBV_DISTFONTNAME);    x1 = MIN(screen.start_x, screen.last_x);    y1 = MIN(screen.start_y, screen.last_y);    x2 = MAX(screen.start_x, screen.last_x);    y2 = MAX(screen.start_y, screen.last_y);    gdk_draw_line(screen.drawing_area->window, gc, screen.start_x,		  screen.start_y, screen.last_x, screen.last_y);    if (font == NULL) {	fprintf(stderr, "Failed to load font '%s'\n", GERBV_DISTFONTNAME);    } else {	gchar string[65];	double delta, dx, dy;	gint lbearing, rbearing, width, ascent, descent;	gint linefeed;	/* Pseudonym for inter line gap */	dx = (x2 - x1)/(double) screen.scale;	dy = (y2 - y1)/(double) screen.scale;	delta = sqrt(dx*dx + dy*dy); /* Pythagoras */	snprintf(string, sizeof(string),		 "[dist %7.1f, dX %7.1f, dY %7.1f] mils",		 COORD2MILS(delta), COORD2MILS(dx), COORD2MILS(dy));	gdk_string_extents(font, string, &lbearing, &rbearing, &width,			   &ascent, &descent);	gdk_draw_string(screen.drawing_area->window, font, gc,			(x1+x2)/2-width/2, (y1+y2)/2, string);	linefeed = ascent+descent;	linefeed *= (double)1.2;	snprintf(string, sizeof(string),		 "[dist %7.2f, dX %7.2f, dY %7.2f] mm",		 COORD2MMS(delta), COORD2MMS(dx), COORD2MMS(dy));	gdk_string_extents(font, string, &lbearing, &rbearing, &width,			   &ascent, &descent);	gdk_draw_string(screen.drawing_area->window, font, gc,			(x1+x2)/2 - width/2, (y1+y2)/2 + linefeed, string);	gdk_font_unref(font);	/*	 * Update statusbar	 */	snprintf(screen.statusbar.diststr, MAX_DISTLEN,		 " dist,dX,dY (%7.1f, %7.1f, %7.1f)mils (%7.2f, %7.2f, %7.2f)mm",		 COORD2MILS(delta), COORD2MILS(dx), COORD2MILS(dy),		 COORD2MMS(delta), COORD2MMS(dx), COORD2MMS(dy));	update_statusbar(&screen);    }    gdk_gc_unref(gc);}