static void place_arc_x(int x, int y) { canvas_leftbut_proc = null_proc; canvas_middlebut_proc = null_proc; canvas_rightbut_proc = null_proc; canvas_locmove_proc = null_proc; canvas_ref_proc = null_proc; adjust_pos(x, y, fix_x, fix_y, &x, &y); translate_arc(new_a, x - fix_x, y - fix_y); if (return_proc == copy_selected) { add_arc(new_a); } else { list_add_arc(&objects.arcs, new_a); clean_up(); set_lastposition(fix_x, fix_y); set_newposition(x, y); set_action_object(F_MOVE, O_ARC); set_latestarc(new_a); set_modifiedflag(); } redisplay_arc(new_a); /* turn back on all relevant markers */ update_markers(new_objmask); (*return_proc) (); draw_mousefun_canvas(); }
static void cancel_drag_arc(void) { canvas_ref_proc = canvas_locmove_proc = null_proc; elastic_movearc(new_a); /* erase last lengths if appres.showlengths is true */ erase_lengths(); if (return_proc == copy_selected) { free_arc(&new_a); } else { list_add_arc(&objects.arcs, new_a); redisplay_arc(new_a); } /* turn back on all relevant markers */ update_markers(new_objmask); (*return_proc) (); draw_mousefun_canvas(); }
void undo_delete(void) { int xmin, ymin, xmax, ymax; char ctemp[PATH_MAX]; switch (last_object) { case O_POLYLINE: list_add_line(&objects.lines, saved_objects.lines); redisplay_line(saved_objects.lines); break; case O_ELLIPSE: list_add_ellipse(&objects.ellipses, saved_objects.ellipses); redisplay_ellipse(saved_objects.ellipses); break; case O_TXT: list_add_text(&objects.texts, saved_objects.texts); redisplay_text(saved_objects.texts); break; case O_SPLINE: list_add_spline(&objects.splines, saved_objects.splines); redisplay_spline(saved_objects.splines); break; case O_ARC: list_add_arc(&objects.arcs, saved_objects.arcs); redisplay_arc(saved_objects.arcs); break; case O_COMPOUND: list_add_compound(&objects.compounds, saved_objects.compounds); redisplay_compound(saved_objects.compounds); break; case O_ALL_OBJECT: saved_objects.next = NULL; compound_bound(&saved_objects, &xmin, &ymin, &xmax, &ymax); tail(&objects, &object_tails); append_objects(&objects, &saved_objects, &object_tails); redisplay_zoomed_region(xmin, ymin, xmax, ymax); } last_action = F_ADD; }