static void fix_movedlinepoint(int x, int y) { (*canvas_locmove_proc) (x, y); canvas_ref_proc = canvas_locmove_proc = null_proc; elastic_linelink(); /* erase last lengths if appres.showlengths is true */ erase_lengths(); if (cur_latexcursor != crosshair_cursor) set_cursor(crosshair_cursor); /* make a copy of the original and save as unchanged object */ old_l = copy_line(cur_l); clean_up(); set_latestline(old_l); set_action_object(F_EDIT, O_POLYLINE); old_l->next = cur_l; /* now change the original to become the new object */ relocate_linepoint(cur_l, cur_x, cur_y, moved_point, left_point); /* redraw anything under the old line */ redisplay_line(old_l); /* and the new line */ redisplay_line(cur_l); /* turn back on all relevant markers */ update_markers(new_objmask); wrapup_movepoint(); }
void reshaping_line(int x, int y) { elastic_linelink(); adjust_pos(x, y, from_x, from_y, &cur_x, &cur_y); /* one or two lines moving with the move point? */ if (left_point != NULL && right_point != NULL) { length_msg2(left_point->x,left_point->y, right_point->x,right_point->y,cur_x,cur_y); } else if (left_point != NULL) { altlength_msg(MSG_LENGTH,left_point->x,left_point->y); } else if (right_point != NULL) { altlength_msg(MSG_LENGTH,right_point->x,right_point->y); } elastic_linelink(); }
static void init_splinepointmoving(void) { set_action_on(); /* turn off all markers */ update_markers(0); from_x = cur_x = moved_point->x; from_y = cur_y = moved_point->y; set_cursor(crosshair_cursor); if (open_spline(cur_s)) { if (left_point == NULL || right_point == NULL) { if (left_point != NULL) { fix_x = left_point->x; fix_y = left_point->y; } else if (right_point != NULL) { fix_x = right_point->x; fix_y = right_point->y; } if (latexline_mode || latexarrow_mode) { canvas_locmove_proc = latex_line; canvas_ref_proc = elastic_line; cur_latexcursor = crosshair_cursor; } else if (mountain_mode || manhattan_mode) { canvas_locmove_proc = constrainedangle_line; canvas_ref_proc = elastic_line; } else { /* freehand line */ canvas_locmove_proc = reshaping_line; canvas_ref_proc = elastic_linelink; } } else { /* linelink, always freehand */ force_noanglegeom(); canvas_locmove_proc = reshaping_line; canvas_ref_proc = elastic_linelink; } } else { /* must be closed spline */ force_noanglegeom(); canvas_locmove_proc = reshaping_line; canvas_ref_proc = elastic_linelink; if (left_point == NULL) { for (left_point = right_point; left_point->next != NULL; left_point = left_point->next); } if (right_point == NULL) { right_point = cur_s->points; /* take the first */ } } /* show current length(s) */ (canvas_locmove_proc)(cur_x, cur_y); elastic_linelink(); canvas_leftbut_proc = fix_movedsplinepoint; canvas_rightbut_proc = cancel_movedsplinepoint; }
static void cancel_movedsplinepoint(void) { canvas_ref_proc = canvas_locmove_proc = null_proc; elastic_linelink(); /* erase last lengths if appres.showlengths is true */ erase_lengths(); /* turn back on all relevant markers */ update_markers(new_objmask); wrapup_movepoint(); }
static void cancel_movedlinepoint(void) { canvas_ref_proc = canvas_locmove_proc = null_proc; /* erase the elastic line */ elastic_linelink(); /* erase last lengths if appres.showlengths is true */ erase_lengths(); /* redraw original line */ redisplay_line(cur_l); /* turn back on all relevant markers */ update_markers(new_objmask); wrapup_movepoint(); }
static void fix_movedsplinepoint(int x, int y) { (*canvas_locmove_proc) (x, y); canvas_ref_proc = canvas_locmove_proc = null_proc; elastic_linelink(); /* erase last lengths if appres.showlengths is true */ erase_lengths(); old_s = copy_spline(cur_s); clean_up(); set_latestspline(old_s); set_action_object(F_EDIT, O_SPLINE); old_s->next = cur_s; relocate_splinepoint(cur_s, cur_x, cur_y, moved_point); /* redraw anything under the old spline */ redisplay_spline(old_s); /* and the new one */ redisplay_spline(cur_s); /* turn back on all relevant markers */ update_markers(new_objmask); wrapup_movepoint(); }