static void fix_movedcompoundpoint(int x, int y) { float scalex, scaley; canvas_ref_proc = canvas_locmove_proc = null_proc; elastic_box(fix_x, fix_y, cur_x, cur_y); /* erase last lengths if appres.showlengths is true */ erase_lengths(); adjust_box_pos(x, y, from_x, from_y, &cur_x, &cur_y); /* make a copy of the original and save as unchanged object */ old_c = copy_compound(cur_c); clean_up(); old_c->next = cur_c; set_latestcompound(old_c); set_action_object(F_EDIT, O_COMPOUND); scalex = ((float) (cur_x - fix_x)) / (from_x - fix_x); scaley = ((float) (cur_y - fix_y)) / (from_y - fix_y); /* scale the compound */ scale_compound(cur_c, scalex, scaley, fix_x, fix_y); /* redraw anything under the old compound */ redisplay_compound(old_c); /* and the new compound */ redisplay_compound(cur_c); /* turn back on all relevant markers */ update_markers(new_objmask); set_lastposition(from_x, from_y); set_newposition(cur_x, cur_y); set_modifiedflag(); wrapup_movepoint(); }
static void fix_box(int x, int y) { canvas_ref_proc = canvas_locmove_proc = null_proc; elastic_box(fix_x, fix_y, cur_x, cur_y); /* erase last lengths if appres.showlengths is true */ erase_box_lengths(); adjust_box_pos(x, y, from_x, from_y, &x, &y); new_l = copy_line(cur_l); if (new_l->type == T_PICTURE) { if (signof(fix_x - from_x) != signof(fix_x - x)) new_l->pic->flipped = 1 - new_l->pic->flipped; if (signof(fix_y - from_y) != signof(fix_y - y)) new_l->pic->flipped = 1 - new_l->pic->flipped; } assign_newboxpoint(new_l, fix_x, fix_y, x, y); change_line(cur_l, new_l); /* redraw anything under the old line */ redisplay_line(cur_l); /* and the new line */ redisplay_line(new_l); /* turn back on all relevant markers */ update_markers(new_objmask); wrapup_movepoint(); }
void scaling_arc(int x, int y) { elastic_scalearc(cur_a); adjust_box_pos(x, y, fix_x, fix_y, &cur_x, &cur_y); elastic_scalearc(cur_a); }
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(); }
void scaling_spline(int x, int y) { elastic_scalepts(cur_s->points); adjust_box_pos(x, y, fix_x, fix_y, &cur_x, &cur_y); elastic_scalepts(cur_s->points); }
void scaling_compound(int x, int y) { elastic_scalecompound(cur_c); adjust_box_pos(x, y, fix_x, fix_y, &cur_x, &cur_y); elastic_scalecompound(cur_c); }
void constrained_resizing_cbd(int x, int y) { elastic_cbd(); adjust_box_pos(x, y, from_x, from_y, &cur_x, &cur_y); length_msg(MSG_DIAM); elastic_cbd(); }
void constrained_resizing_ebr(int x, int y) { elastic_ebr(); adjust_box_pos(x, y, from_x, from_y, &cur_x, &cur_y); length_msg(MSG_RADIUS2); elastic_ebr(); }
void constrained_resizing_scale_box(int x, int y) { elastic_fixedbox(); adjust_box_pos(x, y, from_x, from_y, &cur_x, &cur_y); elastic_fixedbox(); boxsize_scale_msg(1); }
void scaling_line(int x, int y) { elastic_scalepts(cur_l->points); adjust_box_pos(x, y, fix_x, fix_y, &cur_x, &cur_y); if (cur_l->type == T_BOX || cur_l->type == T_ARCBOX || cur_l->type == T_PICTURE) boxsize_msg(2); elastic_scalepts(cur_l->points); }
void scaling_ellipse(int x, int y) { elastic_scaleellipse(cur_e); adjust_box_pos(x, y, fix_x, fix_y, &cur_x, &cur_y); if (cur_e->type == T_ELLIPSE_BY_RAD) length_msg(MSG_RADIUS2); else if (cur_e->type == T_CIRCLE_BY_RAD) length_msg(MSG_RADIUS); else length_msg(MSG_DIAM); elastic_scaleellipse(cur_e); }