Beispiel #1
0
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();
}
Beispiel #2
0
void
resizing_cbd(int x, int y)
{
    elastic_cbd();
    cur_x = x;
    cur_y = y;
    length_msg(MSG_DIAM);
    elastic_cbd();
}
Beispiel #3
0
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();
}
Beispiel #4
0
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();
}
Beispiel #5
0
static void
cancel_circlebydia(void)
{
    elastic_cbd();
    center_marker(fix_x, fix_y);
    circle_ellipse_bydiameter_drawing_selected();
    draw_mousefun_canvas();
}
Beispiel #6
0
static void
init_circlebydiameter_drawing(int x, int y)
{
    cur_mode = F_CIRCLE_BY_DIA;
    cur_x = fix_x = x;
    cur_y = fix_y = y;
    center_marker(fix_x, fix_y);
    set_mousefun("final point", "", "cancel", "", "", "");
    draw_mousefun_canvas();
    canvas_locmove_proc = resizing_cbd;
    canvas_leftbut_proc = create_circlebydia;
    canvas_middlebut_proc = null_proc;
    canvas_rightbut_proc = cancel_circlebydia;
    set_cursor(null_cursor);
    elastic_cbd();
    set_action_on();
}
Beispiel #7
0
static void
create_circlebydia(int x, int y)
{
    F_ellipse	   *c;
    double	    rx, ry;

    elastic_cbd();
    center_marker(fix_x, fix_y);
    if ((c = create_ellipse()) == NULL)
	return;

    c->type = T_CIRCLE_BY_DIA;
    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 = round((fix_x + x) / 2);
    c->center.y = round((fix_y + y) / 2);
    rx = x - c->center.x;
    ry = y - c->center.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_bydiameter_drawing_selected();
    draw_mousefun_canvas();
}