void resizing_cbr(int x, int y) { elastic_cbr(); cur_x = x; cur_y = y; length_msg(MSG_RADIUS); elastic_cbr(); }
static void fix_movedellipsepoint(int x, int y) { switch (cur_e->type) { case T_ELLIPSE_BY_RAD: elastic_ebr(); break; case T_CIRCLE_BY_RAD: elastic_cbr(); break; case T_ELLIPSE_BY_DIA: elastic_ebd(); break; case T_CIRCLE_BY_DIA: elastic_cbd(); break; } canvas_ref_proc = canvas_locmove_proc = null_proc; adjust_box_pos(x, y, from_x, from_y, &cur_x, &cur_y); new_e = copy_ellipse(cur_e); relocate_ellipsepoint(new_e, cur_x, cur_y, movedpoint_num); change_ellipse(cur_e, new_e); /* redraw anything under the old ellipse */ redisplay_ellipse(cur_e); /* and the new one */ redisplay_ellipse(new_e); /* turn back on all relevant markers */ update_markers(new_objmask); wrapup_movepoint(); }
static void cancel_movedellipsepoint(void) { canvas_ref_proc = canvas_locmove_proc = null_proc; /* erase elastic version */ switch (cur_e->type) { case T_ELLIPSE_BY_RAD: elastic_ebr(); break; case T_CIRCLE_BY_RAD: elastic_cbr(); break; case T_ELLIPSE_BY_DIA: elastic_ebd(); break; case T_CIRCLE_BY_DIA: elastic_cbd(); break; } /* redraw original ellipse */ redisplay_ellipse(cur_e); /* turn back on all relevant markers */ update_markers(new_objmask); wrapup_movepoint(); }
static void cancel_circlebyrad(void) { elastic_cbr(); center_marker(fix_x, fix_y); circle_ellipse_byradius_drawing_selected(); draw_mousefun_canvas(); }
static void init_circlebyradius_drawing(int x, int y) { cur_mode = F_CIRCLE_BY_RAD; cur_x = fix_x = x; cur_y = fix_y = y; center_marker(fix_x, fix_y); set_mousefun("set radius", "", "cancel", "", "", ""); draw_mousefun_canvas(); canvas_locmove_proc = resizing_cbr; canvas_leftbut_proc = create_circlebyrad; canvas_middlebut_proc = null_proc; canvas_rightbut_proc = cancel_circlebyrad; set_cursor(null_cursor); elastic_cbr(); set_action_on(); }
static void create_circlebyrad(int x, int y) { F_ellipse *c; double rx, ry; elastic_cbr(); center_marker(fix_x, fix_y); if ((c = create_ellipse()) == NULL) return; c->type = T_CIRCLE_BY_RAD; c->style = cur_linestyle; c->thickness = cur_linewidth; c->style_val = cur_styleval * (cur_linewidth + 1) / 2; c->angle = 0.0; c->pen_color = cur_pencolor; c->fill_color = cur_fillcolor; c->depth = cur_depth; c->pen_style = -1; c->fill_style = cur_fillstyle; c->direction = 1; c->center.x = fix_x; c->center.y = fix_y; rx = fix_x - x; ry = fix_y - y; c->radiuses.x = c->radiuses.y = round(sqrt(rx * rx + ry * ry)); c->start.x = fix_x; c->start.y = fix_y; c->end.x = x; c->end.y = y; c->next = NULL; add_ellipse(c); reset_action_on(); /* this signals redisplay_curobj() not to refresh */ /* draw it and anything on top of it */ redisplay_ellipse(c); circle_ellipse_byradius_drawing_selected(); draw_mousefun_canvas(); }