Index: trunk/src_plugins/hid_gtk/gtkhid-gdk.c =================================================================== --- trunk/src_plugins/hid_gtk/gtkhid-gdk.c (revision 6909) +++ trunk/src_plugins/hid_gtk/gtkhid-gdk.c (revision 6910) @@ -614,7 +614,7 @@ void ghid_draw_arc(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t xradius, pcb_coord_t yradius, pcb_angle_t start_angle, pcb_angle_t delta_angle) { - gint vrx, vry, vrx2, vry2, tune_x, tune_y; + gint vrx2, vry2; double w, h, radius; render_priv *priv = gport->render_priv; @@ -627,8 +627,6 @@ return; USE_GC(gc); - vrx = Vz(xradius); - vry = Vz(yradius); vrx2 = Vz(xradius*2.0); vry2 = Vz(yradius*2.0); @@ -650,15 +648,8 @@ if (start_angle >= 180) start_angle -= 360; - - /* we calculated with doubles but the API needs ints; there might be - an error of +-1 in the rounding that may add up when gdk calculates - the endpoint. This hack will fix that error. */ - tune_x = Vx(cx+xradius) - (Vx(cx - xradius) + vrx2); - tune_y = Vy(cy+yradius) - (Vy(cy - yradius) + vry2); - gdk_draw_arc(gport->drawable, priv->u_gc, 0, - Vx(cx - xradius) + tune_x, Vy(cy - yradius) + tune_y, + pcb_round(Vxd(cx) - Vzd(xradius) + 0.5), pcb_round(Vyd(cy) - Vzd(yradius) + 0.5), pcb_round(vrx2), pcb_round(vry2), (start_angle + 180) * 64, delta_angle * 64); } Index: trunk/src_plugins/hid_gtk/gui.h =================================================================== --- trunk/src_plugins/hid_gtk/gui.h (revision 6909) +++ trunk/src_plugins/hid_gtk/gui.h (revision 6910) @@ -323,6 +323,31 @@ return pcb_round((double)z / gport->view.coord_per_px + 0.5); } +static inline double Vxd(pcb_coord_t x) +{ + double rv; + if (conf_core.editor.view.flip_x) + rv = (PCB->MaxWidth - x - gport->view.x0) / gport->view.coord_per_px; + else + rv = (x - gport->view.x0) / gport->view.coord_per_px; + return rv; +} + +static inline double Vyd(pcb_coord_t y) +{ + double rv; + if (conf_core.editor.view.flip_y) + rv = (PCB->MaxHeight - y - gport->view.y0) / gport->view.coord_per_px; + else + rv = (y - gport->view.y0) / gport->view.coord_per_px; + return rv; +} + +static inline double Vzd(pcb_coord_t z) +{ + return (double)z / gport->view.coord_per_px; +} + static inline pcb_coord_t Px(int x) { pcb_coord_t rv = x * gport->view.coord_per_px + gport->view.x0;