[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: CVS update: a_pan.c
User: pcjc2
Date: 07/02/24 13:43:15
Modified: . a_pan.c i_callbacks.c o_arc.c o_box.c o_buffer.c
o_bus.c o_circle.c o_complex.c o_copy.c o_grips.c
o_line.c o_misc.c o_move.c o_net.c o_picture.c
o_pin.c o_select.c o_text.c x_attribedit.c
x_dialog.c x_event.c
Log:
Merge changes to date from noscreen branch.
Revision Changes Path
1.22 +2 -0 eda/geda/gaf/gschem/src/a_pan.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: a_pan.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/a_pan.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -b -r1.21 -r1.22
--- a_pan.c 14 Jul 2006 02:23:54 -0000 1.21
+++ a_pan.c 24 Feb 2007 18:43:14 -0000 1.22
@@ -111,6 +111,8 @@
SCREENtoWORLD(w_current,
w_current->start_x, w_current->start_y,
&start_x, &start_y);
+ start_x = snap_grid(w_current, start_x);
+ start_y = snap_grid(w_current, start_y);
}
/* calculate the new visible area; adding 0.5 to round */
1.75 +15 -5 eda/geda/gaf/gschem/src/i_callbacks.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: i_callbacks.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/i_callbacks.c,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -b -r1.74 -r1.75
--- i_callbacks.c 23 Feb 2007 19:24:34 -0000 1.74
+++ i_callbacks.c 24 Feb 2007 18:43:14 -0000 1.75
@@ -846,6 +846,7 @@
{
TOPLEVEL *w_current = (TOPLEVEL *) data;
GList *object_list;
+ int w_x, w_y;
exit_if_null(w_current);
o_redraw_cleanstates(w_current);
@@ -855,9 +856,13 @@
if (object_list) {
i_update_middle_button(w_current,
i_callback_edit_rotate_90_hotkey, _("Rotate"));
- /* Allow o_rotate_90 to redraw the objects */
+ /* Allow o_rotate_90_world to redraw the objects */
w_current->DONT_REDRAW = 0;
- o_rotate_90(w_current, object_list, mouse_x, mouse_y);
+ SCREENtoWORLD( w_current, mouse_x, mouse_y, &w_x, &w_y );
+ w_x = snap_grid(w_current, w_x);
+ w_y = snap_grid(w_current, w_y);
+
+ o_rotate_90_world(w_current, object_list, w_x, w_y);
}
w_current->event_state = SELECT;
@@ -889,6 +894,7 @@
{
TOPLEVEL *w_current = (TOPLEVEL *) data;
GList *object_list;
+ int w_x, w_y;
exit_if_null(w_current);
@@ -900,9 +906,13 @@
i_update_middle_button(w_current,
i_callback_edit_mirror_hotkey, _("Mirror"));
- o_mirror(w_current,
+ SCREENtoWORLD( w_current, mouse_x, mouse_y, &w_x, &w_y );
+ w_x = snap_grid(w_current, w_x);
+ w_y = snap_grid(w_current, w_y);
+
+ o_mirror_world(w_current,
object_list,
- mouse_x, mouse_y);
+ w_x, w_y);
}
w_current->event_state = SELECT;
1.27 +20 -23 eda/geda/gaf/gschem/src/o_arc.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_arc.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_arc.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -b -r1.26 -r1.27
--- o_arc.c 7 Dec 2006 04:24:17 -0000 1.26
+++ o_arc.c 24 Feb 2007 18:43:14 -0000 1.27
@@ -108,20 +108,19 @@
* encountered the arc is drawn as a solid arc independently of its
* initial type.
*/
- x = o_current->arc->screen_x;
- y = o_current->arc->screen_y;
- radius = o_current->arc->screen_width / 2;
+ WORLDtoSCREEN( w_current, o_current->arc->x, o_current->arc->y, &x, &y );
+ radius = SCREENabs( w_current, o_current->arc->width / 2 );
start_angle = o_current->arc->start_angle;
end_angle = o_current->arc->end_angle;
#if DEBUG
printf("drawing arc x: %d y: %d sa: %d ea: %d width: %d height: %d\n",
- o_current->arc->screen_x,
- o_current->arc->screen_y,
+ x,
+ y,
o_current->arc->start_angle,
o_current->arc->end_angle,
- o_current->arc->screen_width,
- o_current->arc->screen_height);
+ radius,
+ radius);
#endif
if (w_current->override_color != -1 )
@@ -129,9 +128,8 @@
else
color = x_get_color(o_current->color);
- if(o_current->screen_line_width > 0) {
- arc_width = o_current->screen_line_width;
- } else {
+ arc_width = SCREENabs( w_current, o_current->line_width );
+ if(arc_width <= 0) {
arc_width = 1;
}
@@ -144,8 +142,8 @@
break;
}
- length = o_current->screen_line_length;
- space = o_current->screen_line_space;
+ length = SCREENabs( w_current, o_current->line_length );
+ space = SCREENabs( w_current, o_current->line_space );
switch(o_current->line_type) {
case TYPE_SOLID:
@@ -859,12 +857,13 @@
}
/* diameter */
- width = o_current->arc->screen_width;
+ width = SCREENabs( w_current, o_current->arc->width );
/* height MUST be equal to width, just another name for diameter */
- height = o_current->arc->screen_height;
+ height = SCREENabs( w_current, o_current->arc->height );
/* center */
- x = o_current->arc->screen_x - (width / 2);
- y = o_current->arc->screen_y - (height / 2);
+ WORLDtoSCREEN( w_current, o_current->arc->x, o_current->arc->y, &x, &y );
+ x -= (width / 2);
+ y -= (height / 2);
/* start and end angles */
start_angle = o_current->arc->start_angle;
end_angle = o_current->arc->end_angle;
@@ -1305,14 +1304,13 @@
* <DT>*</DT><DD>one at the end of the arc - at (<B>x2</B>,<B>y2</B>).
*/
- x = o_current->arc->screen_x;
- y = o_current->arc->screen_y;
- radius = o_current->arc->screen_width / 2;
+ WORLDtoSCREEN( w_current, o_current->arc->x, o_current->arc->y, &x, &y );
+ radius = SCREENabs( w_current, o_current->arc->width / 2 );
start_angle = o_current->arc->start_angle;
end_angle = o_current->arc->end_angle;
x1 = x + radius * cos(((double) start_angle) * M_PI / 180);
- y1 = y - radius * sin(((double) start_angle ) * M_PI / 180);
+ y1 = y - radius * sin(((double) start_angle) * M_PI / 180);
x2 = x + radius * cos(((double) (start_angle + end_angle)) * M_PI / 180);
y2 = y - radius * sin(((double) (start_angle + end_angle)) * M_PI / 180);
@@ -1350,9 +1348,8 @@
* and (<B>x2</B>,<B>y2</B>).
*/
- x = o_current->arc->screen_x;
- y = o_current->arc->screen_y;
- radius = o_current->arc->screen_width / 2;
+ WORLDtoSCREEN( w_current, o_current->arc->x, o_current->arc->y, &x, &y );
+ radius = SCREENabs( w_current, o_current->arc->width / 2 );
start_angle = o_current->arc->start_angle;
end_angle = o_current->arc->end_angle;
1.25 +63 -72 eda/geda/gaf/gschem/src/o_box.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_box.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_box.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -b -r1.24 -r1.25
--- o_box.c 7 Dec 2006 04:24:17 -0000 1.24
+++ o_box.c 24 Feb 2007 18:43:14 -0000 1.25
@@ -55,6 +55,7 @@
void o_box_draw(TOPLEVEL *w_current, OBJECT *o_current)
{
int wleft, wright, wtop, wbottom; /* world bounds */
+ int s_upper_x, s_upper_y, s_lower_x, s_lower_y;
int line_width, length, space;
int fill_width, angle1, pitch1, angle2, pitch2;
GdkCapStyle box_end;
@@ -89,14 +90,14 @@
printf("drawing box\n\n");
printf("drawing box: %d %d %d %d\n",
- o_current->box->screen_upper_x,
- o_current->box->screen_upper_y,
- o_current->box->screen_upper_x +
- abs(o_current->box->screen_lower_x -
- o_current->box->screen_upper_x),
- o_current->box->screen_upper_y +
- abs(o_current->box->screen_lower_y -
- o_current->box->screen_upper_y));
+ o_current->box->upper_x,
+ o_current->box->upper_y,
+ o_current->box->upper_x +
+ abs(o_current->box->lower_x -
+ o_current->box->upper_x),
+ o_current->box->upper_y +
+ abs(o_current->box->lower_y -
+ o_current->box->upper_y));
#endif
/*
@@ -126,9 +127,8 @@
* encountered the box is drawn as a solid box independently of its
* initial type.
*/
- if(o_current->screen_line_width > 0) {
- line_width = o_current->screen_line_width;
- } else {
+ line_width = SCREENabs( w_current, o_current->line_width );
+ if(line_width <= 0) {
line_width = 1;
}
@@ -141,8 +141,8 @@
break;
}
- length = o_current->screen_line_length;
- space = o_current->screen_line_space;
+ length = SCREENabs( w_current, o_current->line_length );
+ space = SCREENabs( w_current, o_current->line_space );
switch(o_current->line_type) {
case TYPE_SOLID:
@@ -183,23 +183,22 @@
if((length == 0) || (space == 0))
draw_func = o_box_draw_solid;
+ WORLDtoSCREEN( w_current, o_current->box->upper_x, o_current->box->upper_y,
+ &s_upper_x, &s_upper_y );
+ WORLDtoSCREEN( w_current, o_current->box->lower_x, o_current->box->lower_y,
+ &s_lower_x, &s_lower_y );
+
(*draw_func)(w_current->window, w_current->gc, color, box_end,
FALSE,
- o_current->box->screen_upper_x,
- o_current->box->screen_upper_y,
- abs(o_current->box->screen_lower_x -
- o_current->box->screen_upper_x),
- abs(o_current->box->screen_lower_y -
- o_current->box->screen_upper_y),
+ s_upper_x, s_upper_y,
+ abs(s_lower_x - s_upper_x),
+ abs(s_lower_y - s_upper_y),
line_width, length, space);
(*draw_func)(w_current->backingstore, w_current->gc, color, box_end,
FALSE,
- o_current->box->screen_upper_x,
- o_current->box->screen_upper_y,
- abs(o_current->box->screen_lower_x -
- o_current->box->screen_upper_x),
- abs(o_current->box->screen_lower_y -
- o_current->box->screen_upper_y),
+ s_upper_x, s_upper_y,
+ abs(s_lower_x - s_upper_x),
+ abs(s_lower_y - s_upper_y),
line_width, length, space);
/*
@@ -224,16 +223,15 @@
* to be distinct. If such a case is encountered the circle is filled
* hollow (e.q. not filled).
*/
- if(o_current->screen_fill_width > 0) {
- fill_width = o_current->screen_fill_width;
- } else {
+ fill_width = SCREENabs( w_current, o_current->fill_width );
+ if(fill_width <= 0) {
fill_width = 1;
}
angle1 = o_current->fill_angle1;
- pitch1 = o_current->screen_fill_pitch1;
+ pitch1 = SCREENabs( w_current, o_current->fill_pitch1 );
angle2 = o_current->fill_angle2;
- pitch2 = o_current->screen_fill_pitch2;
+ pitch2 = SCREENabs( w_current, o_current->fill_pitch2 );
switch(o_current->fill_type) {
case FILLING_HOLLOW:
@@ -276,20 +274,14 @@
}
(*fill_func)(w_current->window, w_current->gc, color,
- o_current->box->screen_upper_x,
- o_current->box->screen_upper_y,
- abs(o_current->box->screen_lower_x -
- o_current->box->screen_upper_x),
- abs(o_current->box->screen_lower_y -
- o_current->box->screen_upper_y),
+ s_upper_x, s_upper_y,
+ abs(s_lower_x - s_upper_x),
+ abs(s_lower_y - s_upper_y),
fill_width, angle1, pitch1, angle2, pitch2);
(*fill_func)(w_current->backingstore, w_current->gc, color,
- o_current->box->screen_upper_x,
- o_current->box->screen_upper_y,
- abs(o_current->box->screen_lower_x -
- o_current->box->screen_upper_x),
- abs(o_current->box->screen_lower_y -
- o_current->box->screen_upper_y),
+ s_upper_x, s_upper_y,
+ abs(s_lower_x - s_upper_x),
+ abs(s_lower_y - s_upper_y),
fill_width, angle1, pitch1, angle2, pitch2);
if ((o_current->draw_grips == TRUE) && (w_current->draw_grips == TRUE)) {
@@ -872,10 +864,10 @@
return;
}
- screen_x1 = o_current->box->screen_upper_x;
- screen_y1 = o_current->box->screen_upper_y;
- screen_x2 = o_current->box->screen_lower_x;
- screen_y2 = o_current->box->screen_lower_y;
+ WORLDtoSCREEN( w_current, o_current->box->upper_x, o_current->box->upper_y,
+ &screen_x1, &screen_y1 );
+ WORLDtoSCREEN( w_current, o_current->box->lower_x, o_current->box->lower_y,
+ &screen_x2, &screen_y2 );
if (o_current->saved_color != -1) {
color = o_current->saved_color;
@@ -1092,28 +1084,27 @@
*/
void o_box_draw_grips(TOPLEVEL *w_current, OBJECT *o_current)
{
+ int s_upper_x, s_upper_y, s_lower_x, s_lower_y;
+
if (w_current->draw_grips == FALSE)
return;
+ WORLDtoSCREEN( w_current, o_current->box->upper_x, o_current->box->upper_y,
+ &s_upper_x, &s_upper_y );
+ WORLDtoSCREEN( w_current, o_current->box->lower_x, o_current->box->lower_y,
+ &s_lower_x, &s_lower_y );
+
/* grip on upper left corner (whichone = BOX_UPPER_LEFT) */
- o_grips_draw(w_current,
- o_current->box->screen_upper_x,
- o_current->box->screen_upper_y);
+ o_grips_draw(w_current, s_upper_x, s_upper_y);
/* grip on upper right corner (whichone = BOX_UPPER_RIGHT) */
- o_grips_draw(w_current,
- o_current->box->screen_lower_x,
- o_current->box->screen_upper_y);
+ o_grips_draw(w_current, s_lower_x, s_upper_y);
/* grip on lower left corner (whichone = BOX_LOWER_LEFT) */
- o_grips_draw(w_current,
- o_current->box->screen_upper_x,
- o_current->box->screen_lower_y);
+ o_grips_draw(w_current, s_upper_x, s_lower_y);
/* grip on lower right corner (whichone = BOX_LOWER_RIGHT) */
- o_grips_draw(w_current,
- o_current->box->screen_lower_x,
- o_current->box->screen_lower_y);
+ o_grips_draw(w_current, s_lower_x, s_lower_y);
}
@@ -1127,27 +1118,27 @@
*/
void o_box_erase_grips(TOPLEVEL *w_current, OBJECT *o_current)
{
+ int s_upper_x, s_upper_y, s_lower_x, s_lower_y;
+
if (w_current->draw_grips == FALSE)
return;
+ WORLDtoSCREEN( w_current, o_current->box->upper_x, o_current->box->upper_y,
+ &s_upper_x, &s_upper_y );
+ WORLDtoSCREEN( w_current, o_current->box->lower_x, o_current->box->lower_y,
+ &s_lower_x, &s_lower_y );
+
/* grip on upper left corner (whichone = BOX_UPPER_LEFT) */
- o_grips_erase(w_current,
- o_current->box->screen_upper_x,
- o_current->box->screen_upper_y);
+ o_grips_erase(w_current, s_upper_x, s_upper_y);
/* grip on upper right corner (whichone = BOX_UPPER_RIGHT) */
- o_grips_erase(w_current,
- o_current->box->screen_lower_x,
- o_current->box->screen_upper_y);
+ o_grips_erase(w_current, s_lower_x, s_upper_y);
/* grip on lower left corner (whichone = BOX_LOWER_LEFT) */
- o_grips_erase(w_current,
- o_current->box->screen_upper_x,
- o_current->box->screen_lower_y);
+ o_grips_erase(w_current, s_upper_x, s_lower_y);
/* grip on lower right corner (whichone = BOX_LOWER_RIGHT) */
- o_grips_erase(w_current,
- o_current->box->screen_lower_x,
- o_current->box->screen_lower_y);
+ o_grips_erase(w_current, s_lower_x, s_lower_y);
}
+
1.11 +7 -0 eda/geda/gaf/gschem/src/o_buffer.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_buffer.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_buffer.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- o_buffer.c 21 Dec 2006 20:11:11 -0000 1.10
+++ o_buffer.c 24 Feb 2007 18:43:14 -0000 1.11
@@ -135,6 +135,9 @@
/* now translate selection to current position */
SCREENtoWORLD(w_current, screen_x, screen_y, &x, &y);
+ x = snap_grid(w_current, x);
+ y = snap_grid(w_current, y);
+
w_current->ADDING_SEL = 1;
o_complex_world_translate(w_current, x, y, object_buffer[buf_num]);
w_current->ADDING_SEL = 0;
@@ -184,6 +187,10 @@
SCREENtoWORLD(w_current, screen_x, screen_y, &w_x, &w_y);
SCREENtoWORLD(w_current, w_current->start_x, w_current->start_y,
&w_start_x, &w_start_y);
+ w_x = snap_grid(w_current, w_x);
+ w_y = snap_grid(w_current, w_y);
+ w_start_x = snap_grid(w_current, w_start_x);
+ w_start_y = snap_grid(w_current, w_start_y);
#if DEBUG
printf("%d %d\n", w_x - w_start_x, w_y - w_start_y);
1.24 +12 -8 eda/geda/gaf/gschem/src/o_bus.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_bus.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_bus.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- o_bus.c 10 Feb 2007 21:25:29 -0000 1.23
+++ o_bus.c 24 Feb 2007 18:43:14 -0000 1.24
@@ -132,6 +132,7 @@
{
int size;
int color;
+ int sx[2], sy[2];
if (o_current->line == NULL) {
return;
@@ -154,11 +155,12 @@
GDK_JOIN_MITER);
}
+ WORLDtoSCREEN( w_current, o_current->line->x[0], o_current->line->y[0], &sx[0], &sy[0] );
+ WORLDtoSCREEN( w_current, o_current->line->x[1], o_current->line->y[1], &sx[1], &sy[1] );
+
gdk_draw_line(w_current->window, w_current->outline_xor_gc,
- o_current->line->screen_x[0]+dx,
- o_current->line->screen_y[0]+dy,
- o_current->line->screen_x[1]+dx,
- o_current->line->screen_y[1]+dy);
+ sx[0]+dx, sy[0]+dy,
+ sx[1]+dx, sy[1]+dy);
/* backing store ? not approriate here */
@@ -180,6 +182,7 @@
{
int color;
int dx1= - 1, dy1 = - 1, dx2 = -1, dy2 = -1;
+ int sx[2], sy[2];
if (o_current->line == NULL) {
return;
@@ -218,11 +221,12 @@
fprintf(stderr, _("Got an invalid which one in o_bus_draw_xor_single\n"));
}
+ WORLDtoSCREEN( w_current, o_current->line->x[0], o_current->line->y[0], &sx[0], &sy[0] );
+ WORLDtoSCREEN( w_current, o_current->line->x[1], o_current->line->y[1], &sx[1], &sy[1] );
+
gdk_draw_line(w_current->window, w_current->outline_xor_gc,
- o_current->line->screen_x[0]+dx1,
- o_current->line->screen_y[0]+dy1,
- o_current->line->screen_x[1]+dx2,
- o_current->line->screen_y[1]+dy2);
+ sx[0]+dx1, sy[0]+dy1,
+ sx[1]+dx2, sy[1]+dy2);
/* backing store ? not approriate here */
1.23 +30 -26 eda/geda/gaf/gschem/src/o_circle.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_circle.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_circle.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -b -r1.22 -r1.23
--- o_circle.c 7 Dec 2006 04:24:17 -0000 1.22
+++ o_circle.c 24 Feb 2007 18:43:14 -0000 1.23
@@ -51,6 +51,7 @@
void o_circle_draw(TOPLEVEL *w_current, OBJECT *o_current)
{
int wleft, wright, wtop, wbottom; /* world bounds */
+ int s_x, s_y;
int radius;
int circle_width, length, space;
int fill_width, angle1, pitch1, angle2, pitch2;
@@ -100,7 +101,7 @@
color = x_get_color(o_current->color);
}
- radius = o_current->circle->screen_radius;
+ radius = SCREENabs( w_current, o_current->circle->radius );
/*
* The values describing the line type are extracted from the
@@ -118,14 +119,13 @@
* to an endless loop in function called after. If such a case is encountered
* the circle is drawn as a solid circle independently of its initial type.
*/
- if(o_current->screen_line_width > 0) {
- circle_width = o_current->screen_line_width;
- } else {
+ circle_width = SCREENabs( w_current, o_current->line_width );
+ if(circle_width <= 0) {
circle_width = 1;
}
- length = o_current->screen_line_length;
- space = o_current->screen_line_space;
+ length = SCREENabs( w_current, o_current->line_length );
+ space = SCREENabs( w_current, o_current->line_space );
switch(o_current->line_end) {
case END_NONE: circle_end = GDK_CAP_BUTT; break;
@@ -175,17 +175,18 @@
if((length == 0) || (space == 0))
draw_func = o_arc_draw_solid;
+ WORLDtoSCREEN( w_current, o_current->circle->center_x, o_current->circle->center_y,
+ &s_x, &s_y );
+
(*draw_func)(w_current->window, w_current->gc, color,
circle_end,
- o_current->circle->screen_x,
- o_current->circle->screen_y,
+ s_x, s_y,
radius,
0, FULL_CIRCLE / 64,
circle_width, length, space);
(*draw_func)(w_current->backingstore, w_current->gc, color,
circle_end,
- o_current->circle->screen_x,
- o_current->circle->screen_y,
+ s_x, s_y,
radius,
0, FULL_CIRCLE / 64,
circle_width, length, space);
@@ -211,16 +212,15 @@
* distinct. If such a case is encountered the circle is filled hollow
* (e.q. not filled).
*/
- if(o_current->screen_fill_width > 0) {
- fill_width = o_current->screen_fill_width;
- } else {
+ fill_width = SCREENabs( w_current, o_current->fill_width );
+ if( fill_width <= 0) {
fill_width = 1;
}
angle1 = o_current->fill_angle1;
- pitch1 = o_current->screen_fill_pitch1;
+ pitch1 = SCREENabs( w_current, o_current->fill_pitch1 );
angle2 = o_current->fill_angle2;
- pitch2 = o_current->screen_fill_pitch2;
+ pitch2 = SCREENabs( w_current, o_current->fill_pitch2 );
switch(o_current->fill_type) {
case FILLING_HOLLOW:
@@ -263,13 +263,11 @@
}
(*fill_func)(w_current->window, w_current->gc, color,
- o_current->circle->screen_x,
- o_current->circle->screen_y,
+ s_x, s_y,
radius,
fill_width, angle1, pitch1, angle2, pitch2);
(*fill_func)(w_current->backingstore, w_current->gc, color,
- o_current->circle->screen_x,
- o_current->circle->screen_y,
+ s_x, s_y,
radius,
fill_width, angle1, pitch1, angle2, pitch2);
@@ -567,11 +565,13 @@
}
/* radius of the circle */
- radius = o_current->circle->screen_radius;
+ radius = SCREENabs( w_current, o_current->circle->radius );
/* upper left corner of the square the circle is inscribed in */
/* gdk coords system */
- x = o_current->circle->screen_x - o_current->circle->screen_radius;
- y = o_current->circle->screen_y - o_current->circle->screen_radius;
+ WORLDtoSCREEN( w_current,
+ o_current->circle->center_x - o_current->circle->radius,
+ o_current->circle->center_y + o_current->circle->radius,
+ &x, &y );
/* translate the upper left corner */
x = x + dx;
@@ -801,8 +801,10 @@
return;
/* coords of the lower right corner of the square */
- x = o_current->circle->screen_x + o_current->circle->screen_radius;
- y = o_current->circle->screen_y + o_current->circle->screen_radius;
+ WORLDtoSCREEN( w_current,
+ o_current->circle->center_x + o_current->circle->radius,
+ o_current->circle->center_y - o_current->circle->radius,
+ &x, &y );
/* grip on lower right corner of the square */
o_grips_draw(w_current, x, y);
@@ -827,8 +829,10 @@
return;
/* coords of the lower right corner of square */
- x = o_current->circle->screen_x + o_current->circle->screen_radius;
- y = o_current->circle->screen_y + o_current->circle->screen_radius;
+ WORLDtoSCREEN( w_current,
+ o_current->circle->center_x + o_current->circle->radius,
+ o_current->circle->center_y - o_current->circle->radius,
+ &x, &y );
/* grip on lower right corner of the square */
o_grips_erase(w_current, x, y);
1.31 +19 -138 eda/geda/gaf/gschem/src/o_complex.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_complex.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_complex.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -b -r1.30 -r1.31
--- o_complex.c 21 Dec 2006 20:11:11 -0000 1.30
+++ o_complex.c 24 Feb 2007 18:43:14 -0000 1.31
@@ -188,8 +188,8 @@
{
OBJECT *o_current;
GList *ptr;
- int screen_x_local = -1;
- int screen_y_local = -1;
+ int x_local = -1;
+ int y_local = -1;
int new_angle;
ptr = w_current->page_current->complex_place_list;
@@ -197,14 +197,14 @@
o_current = (OBJECT *) ptr->data;
switch(o_current->type) {
case(OBJ_COMPLEX):
- screen_x_local = o_current->complex->screen_x;
- screen_y_local = o_current->complex->screen_y;
+ x_local = o_current->complex->x;
+ y_local = o_current->complex->y;
break;
}
ptr = ptr->next;
}
- if (screen_x_local == -1) {
+ if (x_local == -1) {
printf(_("Could not find complex in new componet placement!\n"));
return;
}
@@ -216,13 +216,13 @@
case(OBJ_TEXT):
new_angle = (o_current->text->angle + 90) % 360;
- o_text_rotate(w_current, screen_x_local, screen_y_local,
+ o_text_rotate_world(w_current, x_local, y_local,
new_angle, 90, o_current);
break;
case(OBJ_COMPLEX):
new_angle = (o_current->complex->angle + 90) % 360;
- o_complex_rotate(w_current, screen_x_local, screen_y_local,
+ o_complex_rotate_world(w_current, x_local, y_local,
new_angle, 90, o_current);
break;
@@ -253,11 +253,8 @@
diff_y = w_current->last_y - w_current->start_y;
SCREENtoWORLD(w_current, screen_x, screen_y, &x, &y);
-
-#if 0
x = snap_grid(w_current, x);
y = snap_grid(w_current, y);
-#endif
#if DEBUG
printf("place_basename: %s\n",internal_basename);
@@ -353,8 +350,8 @@
for (i = 0; i < temp; i++) {
new_angle = (o_temp->
text->angle + 90) % 360;
- o_text_rotate(w_current,
- screen_x, screen_y,
+ o_text_rotate_world(w_current,
+ x, y,
new_angle, 90, o_temp);
}
break;
@@ -706,26 +703,19 @@
* \par Function Description
*
*/
-void o_complex_rotate(TOPLEVEL *w_current, int centerx, int centery,
+void o_complex_rotate_world(TOPLEVEL *w_current, int centerx, int centery,
int angle, int angle_change, OBJECT *object)
{
int x, y;
int newx, newy;
- int world_centerx, world_centery;
-
- SCREENtoWORLD(w_current,
- centerx,
- centery,
- &world_centerx,
- &world_centery);
- x = object->complex->x + (-world_centerx);
- y = object->complex->y + (-world_centery);
+ x = object->complex->x + (-centerx);
+ y = object->complex->y + (-centery);
rotate_point_90(x, y, 90, &newx, &newy);
- x = newx + (world_centerx);
- y = newy + (world_centery);
+ x = newx + (centerx);
+ y = newy + (centery);
o_complex_world_translate_toplevel(w_current,
-object->complex->x,
@@ -750,21 +740,14 @@
* \par Function Description
*
*/
-int o_complex_mirror(TOPLEVEL *w_current, int centerx, int centery,
+int o_complex_mirror_world(TOPLEVEL *w_current, int world_centerx, int world_centery,
OBJECT *object)
{
int x, y;
int newx, newy;
int origx, origy;
- int world_centerx, world_centery;
int change = 0;
- SCREENtoWORLD(w_current,
- centerx,
- centery,
- &world_centerx,
- &world_centery);
-
origx = object->complex->x;
origy = object->complex->y;
@@ -825,105 +808,3 @@
#endif
return(change);
}
-
-/*! \todo Finish function documentation!!!
- * \brief
- * \par Function Description
- *
- * \note
- * this is a special mirror which doesn't mirror the object in memory,
- * but read the new "correctly mirrored/rotated" object from disk
- * \todo yes this is aweful, and I will eventually fix it, but for now
- * it has to do hack
- */
-OBJECT *o_complex_mirror2(TOPLEVEL *w_current, OBJECT *list,
- int centerx, int centery,
- OBJECT *object)
-{
- OBJECT *new_obj = NULL;
- int x, y;
- int newx, newy;
- int origx, origy;
- int world_centerx, world_centery;
- int change=0;
- int color;
-
- SCREENtoWORLD(w_current,
- centerx,
- centery,
- &world_centerx,
- &world_centery);
-
- origx = object->complex->x;
- origy = object->complex->y;
-
- x = object->complex->x + (-world_centerx);
- y = object->complex->y + (-world_centery);
-
- newx = -x;
- newy = y;
-
- x = newx + (world_centerx);
- y = newy + (world_centery);
-
- switch(object->complex->angle) {
- case(90):
- object->complex->angle = 270;
-#if 0
- o_text_change_angle(w_current, object->complex->prim_objs,
- object->complex->angle);
-#endif
- change = 1;
- break;
-
- case(270):
- object->complex->angle = 90;
-#if 0
- o_text_change_angle(w_current, object->complex->prim_objs,
- object->complex->angle);
-#endif
- change=1;
- break;
-
- }
-
- object->complex->mirror = !object->complex->mirror;
-
- if (object->saved_color == -1) {
- color = object->color;
- } else {
- color = object->saved_color;
- }
-
-
- new_obj = o_complex_add(w_current,
- list, NULL, object->type,
- color,
- x, y,
- object->complex->angle,
- object->complex->mirror,
- object->complex_clib, object->complex_basename,
- 1, FALSE);
-
- /*! \todo fix up name sometime ... */
- new_obj->sid = object->sid;
-
- new_obj->attribs = o_attrib_copy_all(
- w_current, new_obj, object->attribs);
-
- o_attrib_slot_update(w_current, new_obj);
-
- o_complex_delete(w_current, object);
-
- /* need to do the following, because delete severs links */
- o_attrib_reattach(new_obj->attribs);
- o_attrib_set_color(w_current, new_obj->attribs);
-
-
-#if 0
- w_current->page_current->object_tail = (OBJECT *)
- return_tail(w_current->page_current->object_head);
-#endif
-
- return(new_obj);
-}
1.30 +4 -0 eda/geda/gaf/gschem/src/o_copy.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_copy.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_copy.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -b -r1.29 -r1.30
--- o_copy.c 21 Dec 2006 20:40:37 -0000 1.29
+++ o_copy.c 24 Feb 2007 18:43:14 -0000 1.30
@@ -103,6 +103,10 @@
w_current->start_y,
&sx,
&sy);
+ lx = snap_grid(w_current,lx);
+ ly = snap_grid(w_current,ly);
+ sx = snap_grid(w_current,sx);
+ sy = snap_grid(w_current,sy);
diff_x = lx - sx;
diff_y = ly - sy;
1.15 +188 -184 eda/geda/gaf/gschem/src/o_grips.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_grips.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_grips.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- o_grips.c 10 Feb 2007 21:25:29 -0000 1.14
+++ o_grips.c 24 Feb 2007 18:43:14 -0000 1.15
@@ -66,7 +66,7 @@
* inside a grip of one of the selected object on the current sheet.
* The selected object are in a list starting at
* <B>w_current->page_current->selection2_head</B>.
- * The <B>x</B> and <B>y</B> parameters are in screen units.
+ * The <B>x</B> and <B>y</B> parameters are in world units.
* If the point is inside one grip, a pointer on the object it belongs to is
* returned and <B>*whichone</B> is set according to the position of the grip
* on the object.
@@ -77,17 +77,18 @@
* appropriate function.
*
* \param [in] w_current The TOPLEVEL object.
- * \param [in] x Current x coordinate of pointer in screen units.
- * \param [in] y Current y coordinate of pointer in screen units.
+ * \param [in] x Current x coordinate of pointer in world units.
+ * \param [in] y Current y coordinate of pointer in world units.
* \param [out] whichone Which grip point is selected.
* \return Pointer to OBJECT the grip is on, NULL otherwise.
*/
-OBJECT *o_grips_search(TOPLEVEL *w_current, int x, int y, int *whichone)
+OBJECT *o_grips_search_world(TOPLEVEL *w_current, int x, int y, int *whichone)
{
OBJECT *object=NULL;
OBJECT *found=NULL;
GList *s_current;
int size, x2size;
+ int w_size;
if (!whichone) {
return(NULL);
@@ -98,6 +99,8 @@
/* size is half the width of a grip, x2size is full width */
x2size = size * 2;
+ w_size = WORLDabs( w_current, size );
+
/* skip over head */
s_current = w_current->page_current->selection_list;
while (s_current != NULL) {
@@ -106,29 +109,29 @@
switch(object->type) {
case(OBJ_ARC):
/* check the grips of the arc object */
- found = o_grips_search_arc(w_current, object,
- x, y, size, whichone);
+ found = o_grips_search_arc_world(w_current, object,
+ x, y, w_size, whichone);
if(found != NULL) return found;
break;
case(OBJ_BOX):
/* check the grips of the box object */
- found = o_grips_search_box(w_current, object,
- x, y, size, whichone);
+ found = o_grips_search_box_world(w_current, object,
+ x, y, w_size, whichone);
if(found != NULL) return found;
break;
case(OBJ_PICTURE):
/* check the grips of the picture object */
- found = o_grips_search_picture(w_current, object,
- x, y, size, whichone);
+ found = o_grips_search_picture_world(w_current, object,
+ x, y, w_size, whichone);
if(found != NULL) return found;
break;
case(OBJ_CIRCLE):
/* check the grips of the circle object */
- found = o_grips_search_circle(w_current, object,
- x, y, size, whichone);
+ found = o_grips_search_circle_world(w_current, object,
+ x, y, w_size, whichone);
if(found != NULL) return found;
break;
@@ -138,8 +141,8 @@
case(OBJ_BUS):
/* check the grips of the line object */
/* the function is the same for line, pin, net, bus */
- found = o_grips_search_line(w_current, object,
- x, y, size, whichone);
+ found = o_grips_search_line_world(w_current, object,
+ x, y, w_size, whichone);
if(found != NULL) return found;
break;
@@ -180,30 +183,30 @@
* <B>whichone</B> pointed integer is set to <B>ARC_END_ANGLE</B>.
* </DL>
*
- * The <B>x</B> and <B>y</B> parameters are in screen units.
+ * The <B>x</B> and <B>y</B> parameters are in world units.
*
* The <B>size</B> parameter is the width (and height) of the square
- * representing a grip in screen unit.
+ * representing a grip in world units.
*
* \param [in] w_current The TOPLEVEL object.
* \param [in] o_current Arc OBJECT to check.
- * \param [in] x Current x coordinate of pointer in screen units.
- * \param [in] y Current y coordinate of pointer in screen units.
- * \param [in] size Half the width of the grip square in screen units.
+ * \param [in] x Current x coordinate of pointer in world units.
+ * \param [in] y Current y coordinate of pointer in world units.
+ * \param [in] size Half the width of the grip square in world units.
* \param [out] whichone Which grip point is selected.
* \return Pointer to OBJECT the grip is on, NULL otherwise.
*/
-OBJECT *o_grips_search_arc(TOPLEVEL *w_current, OBJECT *o_current,
+OBJECT *o_grips_search_arc_world(TOPLEVEL *w_current, OBJECT *o_current,
int x, int y, int size, int *whichone)
{
int centerx, centery, radius, start_angle, end_angle;
- int left, top, right, bottom;
+ int xmin, ymin, xmax, ymax;
int x2size;
double tmp;
- centerx = o_current->arc->screen_x;
- centery = o_current->arc->screen_y;
- radius = o_current->arc->screen_width / 2;
+ centerx = o_current->arc->x;
+ centery = o_current->arc->y;
+ radius = o_current->arc->width / 2;
start_angle = o_current->arc->start_angle;
end_angle = o_current->arc->end_angle;
@@ -211,33 +214,33 @@
x2size = 2 * size;
/* check the grip on the center of the arc */
- left = centerx - size;
- top = centery - size;
- right = left + x2size;
- bottom = top + x2size;
- if (inside_region(left, top, right, bottom, x, y)) {
+ xmin = centerx - size;
+ ymin = centery - size;
+ xmax = xmin + x2size;
+ ymax = ymin + x2size;
+ if (inside_region(xmin, ymin, xmax, ymax, x, y)) {
*whichone = ARC_RADIUS;
return(o_current);
}
/* check the grip at the start angle of the arc */
tmp = ((double) start_angle) * M_PI / 180;
- left = centerx + radius * cos(tmp) - size;
- top = centery - radius * sin(tmp) - size;
- right = left + x2size;
- bottom = top + x2size;
- if (inside_region(left, top, right, bottom, x, y)) {
+ xmin = centerx + radius * cos(tmp) - size;
+ ymin = centery + radius * sin(tmp) - size;
+ xmax = xmin + x2size;
+ ymax = ymin + x2size;
+ if (inside_region(xmin, ymin, xmax, ymax, x, y)) {
*whichone = ARC_START_ANGLE;
return(o_current);
}
/* check the grip at the end angle of the arc */
tmp = ((double) start_angle + end_angle) * M_PI / 180;
- left = centerx + radius * cos(tmp) - size;
- top = centery - radius * sin(tmp) - size;
- right = left + x2size;
- bottom = top + x2size;
- if (inside_region(left, top, right, bottom, x, y)) {
+ xmin = centerx + radius * cos(tmp) - size;
+ ymin = centery + radius * sin(tmp) - size;
+ xmax = xmin + x2size;
+ ymax = ymin + x2size;
+ if (inside_region(xmin, ymin, xmax, ymax, x, y)) {
*whichone = ARC_END_ANGLE;
return(o_current);
}
@@ -258,64 +261,64 @@
* identifiers of each corner are <B>BOX_UPPER_LEFT</B>,
* <B>BOX_UPPER_RIGHT</B>, <B>BOX_LOWER_LEFT</B> and <B>BOX_LOWER_RIGHT</B>.
*
- * The <B>x</B> and <B>y</B> parameters are in screen units.
+ * The <B>x</B> and <B>y</B> parameters are in world units.
*
* The <B>size</B> parameter is half the width (and half the height) of
- * the square representing a grip in screen unit.
+ * the square representing a grip in world units.
*
* \param [in] w_current The TOPLEVEL object.
* \param [in] o_current Box OBJECT to check.
- * \param [in] x Current x coordinate of pointer in screen units.
- * \param [in] y Current y coordinate of pointer in screen units.
- * \param [in] size Half the width of the grip square in screen units.
+ * \param [in] x Current x coordinate of pointer in world units.
+ * \param [in] y Current y coordinate of pointer in world units.
+ * \param [in] size Half the width of the grip square in world units.
* \param [out] whichone Which grip point is selected.
* \return Pointer to OBJECT the grip is on, NULL otherwise.
*/
-OBJECT *o_grips_search_box(TOPLEVEL *w_current, OBJECT *o_current,
+OBJECT *o_grips_search_box_world(TOPLEVEL *w_current, OBJECT *o_current,
int x, int y, int size, int *whichone)
{
- int left, right, top, bottom;
+ int xmin, ymin, xmax, ymax;
int x2size;
/* width/height of the grip */
x2size = 2 * size;
/* inside upper left grip ? */
- left = o_current->box->screen_upper_x - size;
- top = o_current->box->screen_upper_y - size;
- right = left + x2size;
- bottom = top + x2size;
- if (inside_region(left, top, right, bottom, x, y)) {
+ xmin = o_current->box->upper_x - size;
+ ymin = o_current->box->upper_y - size;
+ xmax = xmin + x2size;
+ ymax = ymin + x2size;
+ if (inside_region(xmin, ymin, xmax, ymax, x, y)) {
*whichone = BOX_UPPER_LEFT;
return(o_current);
}
/* inside lower right grip ? */
- left = o_current->box->screen_lower_x - size;
- top = o_current->box->screen_lower_y - size;
- right = left + x2size;
- bottom = top + x2size;
- if (inside_region(left, top, right, bottom, x, y)) {
+ xmin = o_current->box->lower_x - size;
+ ymin = o_current->box->lower_y - size;
+ xmax = xmin + x2size;
+ ymax = ymin + x2size;
+ if (inside_region(xmin, ymin, xmax, ymax, x, y)) {
*whichone = BOX_LOWER_RIGHT;
return(o_current);
}
/* inside upper right grip ? */
- left = o_current->box->screen_lower_x - size;
- top = o_current->box->screen_upper_y - size;
- right = left + x2size;
- bottom = top + x2size;
- if (inside_region(left, top, right, bottom, x, y)) {
+ xmin = o_current->box->lower_x - size;
+ ymin = o_current->box->upper_y - size;
+ xmax = xmin + x2size;
+ ymax = ymin + x2size;
+ if (inside_region(xmin, ymin, xmax, ymax, x, y)) {
*whichone = BOX_UPPER_RIGHT;
return(o_current);
}
/* inside lower left grip ? */
- left = o_current->box->screen_upper_x - size;
- top = o_current->box->screen_lower_y - size;
- right = left + x2size;
- bottom = top + x2size;
- if (inside_region(left, top, right, bottom, x, y)) {
+ xmin = o_current->box->upper_x - size;
+ ymin = o_current->box->lower_y - size;
+ xmax = xmin + x2size;
+ ymax = ymin + x2size;
+ if (inside_region(xmin, ymin, xmax, ymax, x, y)) {
*whichone = BOX_LOWER_LEFT;
return(o_current);
}
@@ -337,64 +340,64 @@
* #PICTURE_UPPER_RIGHT, #PICTURE_LOWER_LEFT and
* #PICTURE_LOWER_RIGHT.
*
- * The <B>x</B> and <B>y</B> parameters are in screen units.
+ * The <B>x</B> and <B>y</B> parameters are in world units.
*
* The <B>size</B> parameter is half the width (and half the height) of the
- * square representing a grip in screen unit.
+ * square representing a grip in world units.
*
* \param [in] w_current The TOPLEVEL object.
* \param [in] o_current Picture OBJECT to check.
- * \param [in] x Current x coordinate of pointer in screen units.
- * \param [in] y Current y coordinate of pointer in screen units.
- * \param [in] size Half the width of the grip square in screen units.
+ * \param [in] x Current x coordinate of pointer in world units.
+ * \param [in] y Current y coordinate of pointer in world units.
+ * \param [in] size Half the width of the grip square in world units.
* \param [out] whichone Which grip point is selected.
* \return Pointer to OBJECT the grip is on, NULL otherwise.
*/
-OBJECT *o_grips_search_picture(TOPLEVEL *w_current, OBJECT *o_current,
+OBJECT *o_grips_search_picture_world(TOPLEVEL *w_current, OBJECT *o_current,
int x, int y, int size, int *whichone)
{
- int left, right, top, bottom;
+ int xmin, xmax, ymin, ymax;
int x2size;
/* width/height of the grip */
x2size = 2 * size;
/* inside upper left grip ? */
- left = o_current->picture->screen_upper_x - size;
- top = o_current->picture->screen_upper_y - size;
- right = left + x2size;
- bottom = top + x2size;
- if (inside_region(left, top, right, bottom, x, y)) {
+ xmin = o_current->picture->upper_x - size;
+ ymin = o_current->picture->upper_y - size;
+ xmax = xmin + x2size;
+ ymax = ymin + x2size;
+ if (inside_region(xmin, ymin, xmax, ymax, x, y)) {
*whichone = PICTURE_UPPER_LEFT;
return(o_current);
}
/* inside lower right grip ? */
- left = o_current->picture->screen_lower_x - size;
- top = o_current->picture->screen_lower_y - size;
- right = left + x2size;
- bottom = top + x2size;
- if (inside_region(left, top, right, bottom, x, y)) {
+ xmin = o_current->picture->lower_x - size;
+ ymin = o_current->picture->lower_y - size;
+ xmax = xmin + x2size;
+ ymax = ymin + x2size;
+ if (inside_region(xmin, ymin, xmax, ymax, x, y)) {
*whichone = PICTURE_LOWER_RIGHT;
return(o_current);
}
/* inside upper right grip ? */
- left = o_current->picture->screen_lower_x - size;
- top = o_current->picture->screen_upper_y - size;
- right = left + x2size;
- bottom = top + x2size;
- if (inside_region(left, top, right, bottom, x, y)) {
+ xmin = o_current->picture->lower_x - size;
+ ymin = o_current->picture->upper_y - size;
+ xmax = xmin + x2size;
+ ymax = ymin + x2size;
+ if (inside_region(xmin, ymin, xmax, ymax, x, y)) {
*whichone = PICTURE_UPPER_RIGHT;
return(o_current);
}
/* inside lower left grip ? */
- left = o_current->picture->screen_upper_x - size;
- top = o_current->picture->screen_lower_y - size;
- right = left + x2size;
- bottom = top + x2size;
- if (inside_region(left, top, right, bottom, x, y)) {
+ xmin = o_current->picture->upper_x - size;
+ ymin = o_current->picture->lower_y - size;
+ xmax = xmin + x2size;
+ ymax = ymin + x2size;
+ if (inside_region(xmin, ymin, xmax, ymax, x, y)) {
*whichone = PICTURE_LOWER_LEFT;
return(o_current);
}
@@ -413,7 +416,7 @@
* If not, the function returns a <B>NULL</B> pointer and <B>*whichone</B>
* is unchanged.
*
- * The parameter <B>size</B> is half the size of the grip in screen units.
+ * The parameter <B>size</B> is half the size of the grip in world units.
*
* A circle has only one grip on the lower right corner of the box it
* is inscribed in. Moving this grip change the radius of the circle.
@@ -421,16 +424,16 @@
*
* \param [in] w_current The TOPLEVEL object.
* \param [in] o_current Circle OBJECT to check.
- * \param [in] x Current x coordinate of pointer in screen units.
- * \param [in] y Current y coordinate of pointer in screen units.
- * \param [in] size Half the width of the grip square in screen units.
+ * \param [in] x Current x coordinate of pointer in world units.
+ * \param [in] y Current y coordinate of pointer in world units.
+ * \param [in] size Half the width of the grip square in world units.
* \param [out] whichone Which grip point is selected.
* \return Pointer to OBJECT the grip is on, NULL otherwise.
*/
-OBJECT *o_grips_search_circle(TOPLEVEL *w_current, OBJECT *o_current,
+OBJECT *o_grips_search_circle_world(TOPLEVEL *w_current, OBJECT *o_current,
int x, int y, int size, int *whichone)
{
- int left, top, right, bottom;
+ int xmin, ymin, xmax, ymax;
int x1, y1;
int x2size;
@@ -438,13 +441,13 @@
x2size = 2 * size;
/* check the grip for radius */
- x1 = o_current->circle->screen_x + o_current->circle->screen_radius;
- y1 = o_current->circle->screen_y + o_current->circle->screen_radius;
- left = x1 - size;
- top = y1 - size;
- right = left + x2size;
- bottom = top + x2size;
- if (inside_region(left, top, right, bottom, x, y)) {
+ x1 = o_current->circle->center_x + o_current->circle->radius;
+ y1 = o_current->circle->center_y - o_current->circle->radius;
+ xmin = x1 - size;
+ ymin = y1 - size;
+ xmax = xmin + x2size;
+ ymax = ymin + x2size;
+ if (inside_region(xmin, ymin, xmax, ymax, x, y)) {
/* printf("found something 0!\n"); */
*whichone = CIRCLE_RADIUS;
return(o_current);
@@ -463,41 +466,41 @@
* returned and <B>*whichone</B> is set to the identifier of the grip. If not,
* the function returns <B>NULL</B> pointer and <B>*whichone</B> is unchanged.
*
- * The parameter <B>size</B> is half the size of the grip in screen units.
+ * The parameter <B>size</B> is half the size of the grip in world units.
*
* \param [in] w_current The TOPLEVEL object.
* \param [in] o_current Line OBJECT to check.
- * \param [in] x Current x coordinate of pointer in screen units.
- * \param [in] y Current y coordinate of pointer in screen units.
- * \param [in] size Half the width of the grip square in screen units.
+ * \param [in] x Current x coordinate of pointer in world units.
+ * \param [in] y Current y coordinate of pointer in world units.
+ * \param [in] size Half the width of the grip square in world units.
* \param [out] whichone Which grip point is selected.
* \return Pointer to OBJECT the grip is on, NULL otherwise.
*/
-OBJECT *o_grips_search_line(TOPLEVEL *w_current, OBJECT *o_current,
+OBJECT *o_grips_search_line_world(TOPLEVEL *w_current, OBJECT *o_current,
int x, int y, int size, int *whichone)
{
- int left, top, right, bottom;
+ int xmin, ymin, xmax, ymax;
int x2size;
/* width/height of the grip */
x2size = 2 * size;
/* check the grip on the end of line 1 */
- left = o_current->line->screen_x[LINE_END1] - size;
- top = o_current->line->screen_y[LINE_END1] - size;
- right = left + x2size;
- bottom = top + x2size;
- if (inside_region(left, top, right, bottom, x, y)) {
+ xmin = o_current->line->x[LINE_END1] - size;
+ ymin = o_current->line->y[LINE_END1] - size;
+ xmax = xmin + x2size;
+ ymax = ymin + x2size;
+ if (inside_region(xmin, ymin, xmax, ymax, x, y)) {
*whichone = LINE_END1;
return(o_current);
}
/* check the grip on the end of line 2 */
- left = o_current->line->screen_x[LINE_END2] - size;
- top = o_current->line->screen_y[LINE_END2] - size;
- right = left + x2size;
- bottom = top + x2size;
- if (inside_region(left, top, right, bottom, x, y)) {
+ xmin = o_current->line->x[LINE_END2] - size;
+ ymin = o_current->line->y[LINE_END2] - size;
+ xmax = xmin + x2size;
+ ymax = ymin + x2size;
+ if (inside_region(xmin, ymin, xmax, ymax, x, y)) {
*whichone = LINE_END2;
return(o_current);
}
@@ -527,6 +530,7 @@
*/
int o_grips_start(TOPLEVEL *w_current, int x, int y)
{
+ int w_x, w_y;
OBJECT *object;
int whichone;
@@ -534,8 +538,10 @@
return(FALSE);
}
+ SCREENtoWORLD( w_current, x, y, &w_x, &w_y );
+
/* search if there is a grip on a selected object at (x,y) */
- object = o_grips_search(w_current, x, y, &whichone);
+ object = o_grips_search_world(w_current, w_x, w_y, &whichone);
if (object) {
/* there is one */
/* depending on its type, start the modification process */
@@ -587,10 +593,10 @@
case(OBJ_NET):
w_current->last_drawb_mode = -1;
- w_current->last_x = object->line->screen_x[whichone];
- w_current->last_y = object->line->screen_y[whichone];
- w_current->start_x = object->line->screen_x[!whichone];
- w_current->start_y = object->line->screen_y[!whichone];
+ WORLDtoSCREEN( w_current, object->line->x[whichone], object->line->y[whichone],
+ &w_current->last_x, &w_current->last_y );
+ WORLDtoSCREEN( w_current, object->line->x[!whichone], object->line->y[!whichone],
+ &w_current->start_x, &w_current->start_y );
o_net_erase(w_current, object);
gdk_gc_set_foreground(w_current->xor_gc,
@@ -611,10 +617,10 @@
case(OBJ_PIN):
w_current->last_drawb_mode = -1;
- w_current->last_x = object->line->screen_x[whichone];
- w_current->last_y = object->line->screen_y[whichone];
- w_current->start_x = object->line->screen_x[!whichone];
- w_current->start_y = object->line->screen_y[!whichone];
+ WORLDtoSCREEN( w_current, object->line->x[whichone], object->line->y[whichone],
+ &w_current->last_x, &w_current->last_y );
+ WORLDtoSCREEN( w_current, object->line->x[!whichone], object->line->y[!whichone],
+ &w_current->start_x, &w_current->start_y );
o_pin_erase(w_current, object);
gdk_gc_set_foreground(w_current->xor_gc,
@@ -632,10 +638,10 @@
case(OBJ_BUS):
w_current->last_drawb_mode = -1;
- w_current->last_x = object->line->screen_x[whichone];
- w_current->last_y = object->line->screen_y[whichone];
- w_current->start_x = object->line->screen_x[!whichone];
- w_current->start_y = object->line->screen_y[!whichone];
+ WORLDtoSCREEN( w_current, object->line->x[whichone], object->line->y[whichone],
+ &w_current->last_x, &w_current->last_y );
+ WORLDtoSCREEN( w_current, object->line->x[!whichone], object->line->y[!whichone],
+ &w_current->start_x, &w_current->start_y );
o_bus_erase(w_current, object);
gdk_gc_set_foreground(w_current->xor_gc,
@@ -701,10 +707,9 @@
/* describe the arc with TOPLEVEL variables */
/* center */
- w_current->start_x = o_current->arc->screen_x;
- w_current->start_y = o_current->arc->screen_y;
+ WORLDtoSCREEN( w_current, o_current->arc->x, o_current->arc->y, &w_current->start_x, &w_current->start_y );
/* radius */
- w_current->distance = o_current->arc->screen_width / 2;
+ w_current->distance = SCREENabs( w_current, o_current->arc->width / 2 );
/* angles */
w_current->loc_x = o_current->arc->start_angle;
w_current->loc_y = o_current->arc->end_angle;
@@ -747,28 +752,28 @@
/* (start_x, start_y) is the opposite corner */
switch(whichone) {
case BOX_UPPER_LEFT:
- w_current->last_x = o_current->box->screen_upper_x;
- w_current->last_y = o_current->box->screen_upper_y;
- w_current->start_x = o_current->box->screen_lower_x;
- w_current->start_y = o_current->box->screen_lower_y;
+ WORLDtoSCREEN( w_current, o_current->box->upper_x, o_current->box->upper_y,
+ &w_current->last_x, &w_current->last_y );
+ WORLDtoSCREEN( w_current, o_current->box->lower_x, o_current->box->lower_y,
+ &w_current->start_x, &w_current->start_y );
break;
case BOX_LOWER_RIGHT:
- w_current->last_x = o_current->box->screen_lower_x;
- w_current->last_y = o_current->box->screen_lower_y;
- w_current->start_x = o_current->box->screen_upper_x;
- w_current->start_y = o_current->box->screen_upper_y;
+ WORLDtoSCREEN( w_current, o_current->box->lower_x, o_current->box->lower_y,
+ &w_current->last_x, &w_current->last_y );
+ WORLDtoSCREEN( w_current, o_current->box->upper_x, o_current->box->upper_y,
+ &w_current->start_x, &w_current->start_y );
break;
case BOX_UPPER_RIGHT:
- w_current->last_x = o_current->box->screen_lower_x;
- w_current->last_y = o_current->box->screen_upper_y;
- w_current->start_x = o_current->box->screen_upper_x;
- w_current->start_y = o_current->box->screen_lower_y;
+ WORLDtoSCREEN( w_current, o_current->box->lower_x, o_current->box->upper_y,
+ &w_current->last_x, &w_current->last_y );
+ WORLDtoSCREEN( w_current, o_current->box->upper_x, o_current->box->lower_y,
+ &w_current->start_x, &w_current->start_y );
break;
case BOX_LOWER_LEFT:
- w_current->last_x = o_current->box->screen_upper_x;
- w_current->last_y = o_current->box->screen_lower_y;
- w_current->start_x = o_current->box->screen_lower_x;
- w_current->start_y = o_current->box->screen_upper_y;
+ WORLDtoSCREEN( w_current, o_current->box->upper_x, o_current->box->lower_y,
+ &w_current->last_x, &w_current->last_y );
+ WORLDtoSCREEN( w_current, o_current->box->lower_x, o_current->box->upper_y,
+ &w_current->start_x, &w_current->start_y );
break;
default:
return; /* error */
@@ -815,28 +820,28 @@
/* (start_x, start_y) is the opposite corner */
switch(whichone) {
case PICTURE_UPPER_LEFT:
- w_current->last_x = o_current->picture->screen_upper_x;
- w_current->last_y = o_current->picture->screen_upper_y;
- w_current->start_x = o_current->picture->screen_lower_x;
- w_current->start_y = o_current->picture->screen_lower_y;
+ WORLDtoSCREEN( w_current, o_current->picture->upper_x, o_current->picture->upper_y,
+ &w_current->last_x, &w_current->last_y );
+ WORLDtoSCREEN( w_current, o_current->picture->lower_x, o_current->picture->lower_y,
+ &w_current->start_x, &w_current->start_y );
break;
case PICTURE_LOWER_RIGHT:
- w_current->last_x = o_current->picture->screen_lower_x;
- w_current->last_y = o_current->picture->screen_lower_y;
- w_current->start_x = o_current->picture->screen_upper_x;
- w_current->start_y = o_current->picture->screen_upper_y;
+ WORLDtoSCREEN( w_current, o_current->picture->lower_x, o_current->picture->lower_y,
+ &w_current->last_x, &w_current->last_y );
+ WORLDtoSCREEN( w_current, o_current->picture->upper_x, o_current->picture->upper_y,
+ &w_current->start_x, &w_current->start_y );
break;
case PICTURE_UPPER_RIGHT:
- w_current->last_x = o_current->picture->screen_lower_x;
- w_current->last_y = o_current->picture->screen_upper_y;
- w_current->start_x = o_current->picture->screen_upper_x;
- w_current->start_y = o_current->picture->screen_lower_y;
+ WORLDtoSCREEN( w_current, o_current->picture->lower_x, o_current->picture->upper_y,
+ &w_current->last_x, &w_current->last_y );
+ WORLDtoSCREEN( w_current, o_current->picture->upper_x, o_current->picture->lower_y,
+ &w_current->start_x, &w_current->start_y );
break;
case PICTURE_LOWER_LEFT:
- w_current->last_x = o_current->picture->screen_upper_x;
- w_current->last_y = o_current->picture->screen_lower_y;
- w_current->start_x = o_current->picture->screen_lower_x;
- w_current->start_y = o_current->picture->screen_upper_y;
+ WORLDtoSCREEN( w_current, o_current->picture->upper_x, o_current->picture->lower_y,
+ &w_current->last_x, &w_current->last_y );
+ WORLDtoSCREEN( w_current, o_current->picture->lower_x, o_current->picture->upper_y,
+ &w_current->start_x, &w_current->start_y );
break;
default:
return; /* error */
@@ -879,14 +884,13 @@
/* describe the circle with TOPLEVEL variables */
/* (start_x, start_y) is the center of the circle */
- w_current->start_x = o_current->circle->screen_x;
- w_current->start_y = o_current->circle->screen_y;
+ WORLDtoSCREEN( w_current, o_current->circle->center_x, o_current->circle->center_y,
+ &w_current->start_x, &w_current->start_y );
/* (last_x,last_y) is the point on circle on the right of center */
- w_current->last_x = o_current->circle->screen_x +
- o_current->circle->screen_radius;
- w_current->last_y = o_current->circle->screen_y;
+ WORLDtoSCREEN( w_current, o_current->circle->center_x + o_current->circle->radius, o_current->circle->center_y,
+ &w_current->last_x, &w_current->last_y );
/* distance is the radius of the circle */
- w_current->distance = o_current->circle->screen_radius;
+ w_current->distance = SCREENabs( w_current, o_current->circle->radius );
/* draw the first temporary circle */
o_circle_rubbercircle_xor(w_current);
@@ -922,10 +926,10 @@
o_line_erase(w_current, o_current);
/* describe the line with TOPLEVEL variables */
- w_current->last_x = o_current->line->screen_x[whichone];
- w_current->last_y = o_current->line->screen_y[whichone];
- w_current->start_x = o_current->line->screen_x[!whichone];
- w_current->start_y = o_current->line->screen_y[!whichone];
+ WORLDtoSCREEN( w_current, o_current->line->x[whichone], o_current->line->y[whichone],
+ &w_current->last_x, &w_current->last_y );
+ WORLDtoSCREEN( w_current, o_current->line->x[!whichone], o_current->line->y[!whichone],
+ &w_current->start_x, &w_current->start_y );
/* draw the first temporary line */
o_line_rubberline_xor(w_current);
@@ -1731,8 +1735,8 @@
* <B>x</B> and <B>y</B> are in screen unit.
*
* \param [in] w_current The TOPLEVEL object.
- * \param [in] x Center x coordinate for drawing grip.
- * \param [in] y Center y coordinate for drawing grip.
+ * \param [in] x Center x screen coordinate for drawing grip.
+ * \param [in] y Center y screen coordinate for drawing grip.
*/
void o_grips_draw(TOPLEVEL *w_current, int x, int y)
{
@@ -1793,8 +1797,8 @@
* visible grip.
*
* \param [in] w_current The TOPLEVEL object.
- * \param [in] x Center x coordinate for drawing grip.
- * \param [in] y Center y coordinate for drawing grip.
+ * \param [in] x Center x screen coordinate for drawing grip.
+ * \param [in] y Center y screen coordinate for drawing grip.
*/
void o_grips_erase(TOPLEVEL *w_current, int x, int y)
{
1.24 +27 -23 eda/geda/gaf/gschem/src/o_line.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_line.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_line.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- o_line.c 7 Dec 2006 04:24:17 -0000 1.23
+++ o_line.c 24 Feb 2007 18:43:14 -0000 1.24
@@ -73,8 +73,8 @@
#if DEBUG
printf("drawing line\n\n");
printf("drawing line : %d,%d to %d,%d\n",
- o_current->line->x1, o_current->line->y1,
- o_current->line->x2, o_current->line->y2);
+ x1, y1,
+ x2, y2);
#endif
/*
@@ -105,9 +105,8 @@
else
color = x_get_color(o_current->color);
- if(o_current->screen_line_width > 0) {
- line_width = o_current->screen_line_width;
- } else {
+ line_width = SCREENabs( w_current, o_current->line_width );
+ if( line_width <= 0) {
line_width = 1;
}
@@ -121,8 +120,8 @@
break;
}
- length = o_current->screen_line_length;
- space = o_current->screen_line_space;
+ length = SCREENabs( w_current, o_current->line_length );
+ space = SCREENabs( w_current, o_current->line_space );
switch(o_current->line_type) {
case TYPE_SOLID:
@@ -778,6 +777,7 @@
void o_line_draw_xor(TOPLEVEL *w_current, int dx, int dy, OBJECT *o_current)
{
int color;
+ int sx[2], sy[2];
if (o_current->line == NULL) {
return;
@@ -792,11 +792,13 @@
/* changed for dark color stuff */
gdk_gc_set_foreground(w_current->outline_xor_gc,
x_get_darkcolor(color));
+
+ WORLDtoSCREEN( w_current, o_current->line->x[0], o_current->line->y[0], &sx[0], &sy[0] );
+ WORLDtoSCREEN( w_current, o_current->line->x[1], o_current->line->y[1], &sx[1], &sy[1] );
+
gdk_draw_line(w_current->window, w_current->outline_xor_gc,
- o_current->line->screen_x[0]+dx,
- o_current->line->screen_y[0]+dy,
- o_current->line->screen_x[1]+dx,
- o_current->line->screen_y[1]+dy);
+ sx[0]+dx, sy[0]+dy,
+ sx[1]+dx, sy[1]+dy);
/* backing store? nope not here */
}
@@ -996,18 +998,19 @@
*/
void o_line_draw_grips(TOPLEVEL *w_current, OBJECT *o_current)
{
+ int x[2], y[2];
+
if (w_current->draw_grips == FALSE)
return;
+ WORLDtoSCREEN( w_current, o_current->line->x[0], o_current->line->y[0], &x[0], &y[0] );
+ WORLDtoSCREEN( w_current, o_current->line->x[1], o_current->line->y[1], &x[1], &y[1] );
+
/* draw the grip on line end 1 */
- o_grips_draw(w_current,
- o_current->line->screen_x[LINE_END1],
- o_current->line->screen_y[LINE_END1]);
+ o_grips_draw(w_current, x[LINE_END1], y[LINE_END1]);
/* draw the grip on line end 2 */
- o_grips_draw(w_current,
- o_current->line->screen_x[LINE_END2],
- o_current->line->screen_y[LINE_END2]);
+ o_grips_draw(w_current, x[LINE_END2], y[LINE_END2]);
}
/*! \brief Erase grip marks from line.
@@ -1021,17 +1024,18 @@
*/
void o_line_erase_grips(TOPLEVEL *w_current, OBJECT *o_current)
{
+ int x[2], y[2];
+
if (w_current->draw_grips == FALSE)
return;
+ WORLDtoSCREEN( w_current, o_current->line->x[0], o_current->line->y[0], &x[0], &y[0] );
+ WORLDtoSCREEN( w_current, o_current->line->x[1], o_current->line->y[1], &x[1], &y[1] );
+
/* erase the grip on line end 1 */
- o_grips_erase(w_current,
- o_current->line->screen_x[LINE_END1],
- o_current->line->screen_y[LINE_END1]);
+ o_grips_erase(w_current, x[LINE_END1], y[LINE_END1]);
/* erase the grip on line end 2 */
- o_grips_erase(w_current,
- o_current->line->screen_x[LINE_END2],
- o_current->line->screen_y[LINE_END2]);
+ o_grips_erase(w_current, x[LINE_END2], y[LINE_END2]);
}
1.42 +23 -29 eda/geda/gaf/gschem/src/o_misc.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_misc.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_misc.c,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -b -r1.41 -r1.42
--- o_misc.c 10 Jan 2007 02:01:13 -0000 1.41
+++ o_misc.c 24 Feb 2007 18:43:14 -0000 1.42
@@ -202,7 +202,7 @@
* \param [in] centerx Center x coordinate of rotation.
* \param [in] centery Center y coordinate of rotation.
*/
-void o_rotate_90(TOPLEVEL *w_current, GList *list,
+void o_rotate_90_world(TOPLEVEL *w_current, GList *list,
int centerx, int centery)
{
OBJECT *object;
@@ -248,7 +248,7 @@
other_objects = s_conn_return_others(other_objects, object);
s_conn_remove(w_current, object);
- o_net_rotate(w_current, centerx, centery, 90, object);
+ o_net_rotate_world(w_current, centerx, centery, 90, object);
s_conn_update_object(w_current, object);
if (!w_current->DONT_REDRAW) {
o_net_draw(w_current, object);
@@ -279,7 +279,7 @@
other_objects = s_conn_return_others(other_objects, object);
s_conn_remove(w_current, object);
- o_bus_rotate(w_current, centerx, centery, 90, object);
+ o_bus_rotate_world(w_current, centerx, centery, 90, object);
s_conn_update_object(w_current, object);
if (!w_current->DONT_REDRAW) {
o_bus_draw(w_current, object);
@@ -310,7 +310,7 @@
other_objects = s_conn_return_others(other_objects, object);
s_conn_remove(w_current, object);
- o_pin_rotate(w_current, centerx, centery,
+ o_pin_rotate_world(w_current, centerx, centery,
90, object);
s_conn_update_object(w_current, object);
if (!w_current->DONT_REDRAW) {
@@ -351,7 +351,7 @@
/* do the rotate */
/*w_current->ADDING_SEL=1; NEWSEL: needed? */
new_angle = (object->complex->angle + 90) % 360;
- o_complex_rotate(w_current, centerx, centery,
+ o_complex_rotate_world(w_current, centerx, centery,
new_angle, 90, object);
/*w_current->ADDING_SEL = 0; NEWSEL: needed? */
s_conn_update_complex(w_current, object->complex->prim_objs);
@@ -377,7 +377,7 @@
o_line_erase(w_current, object);
}
- o_line_rotate(w_current, centerx, centery,
+ o_line_rotate_world(w_current, centerx, centery,
90, object);
if (!w_current->DONT_REDRAW) {
@@ -392,7 +392,7 @@
o_box_erase(w_current, object);
}
- o_box_rotate(w_current, centerx, centery,
+ o_box_rotate_world(w_current, centerx, centery,
90, object);
if (!w_current->DONT_REDRAW) {
@@ -408,7 +408,7 @@
o_picture_erase(w_current, object);
}
- o_picture_rotate(w_current, centerx, centery,
+ o_picture_rotate_world(w_current, centerx, centery,
90, object);
if (!w_current->DONT_REDRAW) {
@@ -422,7 +422,7 @@
o_circle_erase(w_current, object);
}
- o_circle_rotate(w_current, centerx, centery,
+ o_circle_rotate_world(w_current, centerx, centery,
90, object);
if (!w_current->DONT_REDRAW) {
@@ -435,13 +435,7 @@
o_arc_erase(w_current, object);
}
-#if 0 /* not needed anymore */
- SCREENtoWORLD(w_current, centerx, centery,
- &world_centerx, &world_centery);
- o_arc_rotate_world(w_current, world_centerx, world_centery, 90, object);
-#endif
-
- o_arc_rotate(w_current, centerx, centery, 90, object);
+ o_arc_rotate_world(w_current, centerx, centery, 90, object);
if (!w_current->DONT_REDRAW) {
o_arc_draw(w_current, object);
}
@@ -454,7 +448,7 @@
}
new_angle = (object->text->angle + 90) % 360;
- o_text_rotate(w_current, centerx, centery,
+ o_text_rotate_world(w_current, centerx, centery,
new_angle, 90, object);
if (!w_current->DONT_REDRAW) {
@@ -519,7 +513,7 @@
* \par Function Description
*
*/
-void o_mirror(TOPLEVEL *w_current, GList *list, int centerx, int centery)
+void o_mirror_world(TOPLEVEL *w_current, GList *list, int centerx, int centery)
{
OBJECT *object;
GList *s_current;
@@ -560,7 +554,7 @@
other_objects = s_conn_return_others(other_objects, object);
s_conn_remove(w_current, object);
- o_net_mirror(w_current, centerx, centery, object);
+ o_net_mirror_world(w_current, centerx, centery, object);
s_conn_update_object(w_current, object);
o_net_draw(w_current, object);
@@ -585,7 +579,7 @@
other_objects = s_conn_return_others(other_objects, object);
s_conn_remove(w_current, object);
- o_pin_mirror(w_current, centerx, centery, object);
+ o_pin_mirror_world(w_current, centerx, centery, object);
s_conn_update_object(w_current, object);
o_pin_draw(w_current, object);
@@ -609,7 +603,7 @@
other_objects = s_conn_return_others(other_objects, object);
s_conn_remove(w_current, object);
- o_bus_mirror(w_current, centerx, centery, object);
+ o_bus_mirror_world(w_current, centerx, centery, object);
s_conn_update_object(w_current, object);
o_bus_draw(w_current, object);
@@ -640,7 +634,7 @@
o_current = o_current->next;
}
- o_complex_mirror(w_current, centerx, centery, object);
+ o_complex_mirror_world(w_current, centerx, centery, object);
s_conn_update_complex(w_current, object->complex->prim_objs);
o_complex_draw(w_current, object);
@@ -657,7 +651,7 @@
case(OBJ_LINE):
o_line_erase_grips(w_current, object);
o_line_erase(w_current, object);
- o_line_mirror(w_current,
+ o_line_mirror_world(w_current,
centerx, centery, object);
o_line_draw(w_current, object);
break;
@@ -665,7 +659,7 @@
case(OBJ_BOX):
o_box_erase_grips(w_current, object);
o_box_erase(w_current, object);
- o_box_mirror(w_current,
+ o_box_mirror_world(w_current,
centerx, centery, object);
o_box_draw(w_current, object);
break;
@@ -673,7 +667,7 @@
case(OBJ_PICTURE):
o_picture_erase_grips(w_current, object);
o_picture_erase(w_current, object);
- o_picture_mirror(w_current,
+ o_picture_mirror_world(w_current,
centerx, centery, object);
o_picture_draw(w_current, object);
break;
@@ -681,7 +675,7 @@
case(OBJ_CIRCLE):
o_circle_erase_grips(w_current, object);
o_circle_erase(w_current, object);
- o_circle_mirror(w_current,
+ o_circle_mirror_world(w_current,
centerx, centery, object);
o_circle_draw(w_current, object);
break;
@@ -692,13 +686,13 @@
SCREENtoWORLD(w_current, centerx, centery,
&world_centerx, &world_centery);
#endif
- o_arc_mirror(w_current, centerx, centery, object);
+ o_arc_mirror_world(w_current, centerx, centery, object);
o_arc_draw(w_current, object);
break;
case(OBJ_TEXT):
o_text_erase(w_current, object);
- o_text_mirror(w_current,
+ o_text_mirror_world(w_current,
centerx, centery, object);
o_text_draw(w_current, object);
break;
1.31 +4 -6 eda/geda/gaf/gschem/src/o_move.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_move.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_move.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -b -r1.30 -r1.31
--- o_move.c 17 Dec 2006 04:14:03 -0000 1.30
+++ o_move.c 24 Feb 2007 18:43:14 -0000 1.31
@@ -76,7 +76,6 @@
*/
void o_move_end_lowlevel(TOPLEVEL * w_current, OBJECT * list, int type,
int diff_x, int diff_y,
- int screen_diff_x, int screen_diff_y,
GList** other_objects, GList** connected_objects)
{
OBJECT *o_current;
@@ -169,7 +168,6 @@
GList *s_current = NULL;
OBJECT *object;
int diff_x, diff_y;
- int screen_diff_x, screen_diff_y;
int lx, ly;
int sx, sy;
int left, top, right, bottom;
@@ -188,13 +186,15 @@
return;
}
- screen_diff_x = w_current->last_x - w_current->start_x;
- screen_diff_y = w_current->last_y - w_current->start_y;
SCREENtoWORLD(w_current, w_current->last_x, w_current->last_y,
&lx, &ly);
SCREENtoWORLD(w_current, w_current->start_x, w_current->start_y,
&sx, &sy);
+ lx = snap_grid(w_current, lx);
+ ly = snap_grid(w_current, ly);
+ sx = snap_grid(w_current, sx);
+ sy = snap_grid(w_current, sy);
diff_x = lx - sx;
diff_y = ly - sy;
@@ -236,7 +236,6 @@
case (OBJ_ARC):
case (OBJ_TEXT):
o_move_end_lowlevel(w_current, object, SINGLE, diff_x, diff_y,
- screen_diff_x, screen_diff_y,
&other_objects, &connected_objects);
break;
@@ -262,7 +261,6 @@
o_move_end_lowlevel(w_current, object->complex->prim_objs,
COMPLEX, diff_x, diff_y,
- screen_diff_x, screen_diff_y,
&other_objects, &connected_objects);
1.32 +30 -18 eda/geda/gaf/gschem/src/o_net.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_net.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_net.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -b -r1.31 -r1.32
--- o_net.c 10 Feb 2007 21:25:29 -0000 1.31
+++ o_net.c 24 Feb 2007 18:43:14 -0000 1.32
@@ -176,6 +176,7 @@
{
int size;
int color;
+ int sx[2], sy[2];
if (o_current->line == NULL) {
return;
@@ -198,11 +199,13 @@
GDK_JOIN_MITER);
}
+ WORLDtoSCREEN( w_current, o_current->line->x[0], o_current->line->y[0], &sx[0], &sy[0] );
+ WORLDtoSCREEN( w_current, o_current->line->x[1], o_current->line->y[1], &sx[1], &sy[1] );
+
gdk_draw_line(w_current->window, w_current->outline_xor_gc,
- o_current->line->screen_x[0]+dx,
- o_current->line->screen_y[0]+dy,
- o_current->line->screen_x[1]+dx,
- o_current->line->screen_y[1]+dy);
+ sx[0]+dx, sy[0]+dy,
+ sx[1]+dx, sy[1]+dy);
+
/* backing store ? not approriate here */
@@ -224,6 +227,7 @@
{
int color;
int dx1 = -1, dx2 = -1, dy1 = -1,dy2 = -1;
+ int sx[2], sy[2];
if (o_current->line == NULL) {
return;
@@ -262,11 +266,12 @@
fprintf(stderr, _("Got an invalid which one in o_net_draw_xor_single\n"));
}
+ WORLDtoSCREEN( w_current, o_current->line->x[0], o_current->line->y[0], &sx[0], &sy[0] );
+ WORLDtoSCREEN( w_current, o_current->line->x[1], o_current->line->y[1], &sx[1], &sy[1] );
+
gdk_draw_line(w_current->window, w_current->outline_xor_gc,
- o_current->line->screen_x[0]+dx1,
- o_current->line->screen_y[0]+dy1,
- o_current->line->screen_x[1]+dx2,
- o_current->line->screen_y[1]+dy2);
+ sx[0]+dx1, sy[0]+dy1,
+ sx[1]+dx2, sy[1]+dy2);
/* backing store ? not approriate here */
@@ -411,6 +416,7 @@
int size;
int primary_zero_length, secondary_zero_length;
int found_primary_connection = FALSE;
+ int sx[2], sy[2];
/*int temp_x, temp_y;*/
/* OBJECT *o_current;*/
@@ -542,13 +548,16 @@
s_conn_print(new_net->conn_list);
#endif
+ WORLDtoSCREEN( w_current, new_net->line->x[0], new_net->line->y[0], &sx[0], &sy[0] );
+ WORLDtoSCREEN( w_current, new_net->line->x[1], new_net->line->y[1], &sx[1], &sy[1] );
+
gdk_gc_set_foreground(w_current->gc, x_get_color(color));
gdk_draw_line(w_current->window, w_current->gc,
- new_net->line->screen_x[0], new_net->line->screen_y[0],
- new_net->line->screen_x[1], new_net->line->screen_y[1]);
+ sx[0], sy[0],
+ sx[1], sy[1]);
gdk_draw_line(w_current->backingstore, w_current->gc,
- new_net->line->screen_x[0], new_net->line->screen_y[0],
- new_net->line->screen_x[1], new_net->line->screen_y[1]);
+ sx[0], sy[0],
+ sx[1], sy[1]);
if (w_current->net_style == THICK) {
gdk_gc_set_line_attributes(w_current->gc, 0,
@@ -602,13 +611,16 @@
s_conn_print(new_net->conn_list);
#endif
+ WORLDtoSCREEN( w_current, new_net->line->x[0], new_net->line->y[0], &sx[0], &sy[0] );
+ WORLDtoSCREEN( w_current, new_net->line->x[1], new_net->line->y[1], &sx[1], &sy[1] );
+
gdk_gc_set_foreground(w_current->gc, x_get_color(color));
gdk_draw_line(w_current->window, w_current->gc,
- new_net->line->screen_x[0], new_net->line->screen_y[0],
- new_net->line->screen_x[1], new_net->line->screen_y[1]);
+ sx[0], sy[0],
+ sx[1], sy[1]);
gdk_draw_line(w_current->backingstore, w_current->gc,
- new_net->line->screen_x[0], new_net->line->screen_y[0],
- new_net->line->screen_x[1], new_net->line->screen_y[1]);
+ sx[0], sy[0],
+ sx[1], sy[1]);
if (w_current->net_style == THICK) {
gdk_gc_set_line_attributes(w_current->gc, 0,
1.11 +62 -82 eda/geda/gaf/gschem/src/o_picture.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_picture.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_picture.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- o_picture.c 2 Jan 2007 17:39:40 -0000 1.10
+++ o_picture.c 24 Feb 2007 18:43:14 -0000 1.11
@@ -342,6 +342,8 @@
void o_picture_draw(TOPLEVEL *w_current, OBJECT *o_current)
{
int wleft, wright, wtop, wbottom; /* world bounds */
+ int s_upper_x, s_upper_y, s_lower_x, s_lower_y;
+
if (o_current->picture == NULL) {
return;
}
@@ -366,18 +368,18 @@
return;
}
+ WORLDtoSCREEN( w_current, o_current->picture->upper_x, o_current->picture->upper_y,
+ &s_upper_x, &s_upper_y );
+ WORLDtoSCREEN( w_current, o_current->picture->lower_x, o_current->picture->lower_y,
+ &s_lower_x, &s_lower_y );
+
#if DEBUG
printf("drawing picture\n\n");
printf("drawing picture: %d %d %d %d\n",
- o_current->picture->screen_upper_x,
- o_current->picture->screen_upper_y,
- o_current->picture->screen_upper_x +
- abs(o_current->picture->screen_lower_x -
- o_current->picture->screen_upper_x),
- o_current->picture->screen_upper_y +
- abs(o_current->picture->screen_lower_y -
- o_current->picture->screen_upper_y));
+ s_upper_x, s_upper_y,
+ s_upper_x + abs(s_lower_x - s_upper_x),
+ s_upper_y + abs(s_lower_y - s_upper_y));
#endif
/*
@@ -413,10 +415,8 @@
o_current->picture->displayed_picture =
gdk_pixbuf_scale_simple(temp_pixbuf2,
- abs(o_current->picture->screen_lower_x -
- o_current->picture->screen_upper_x),
- abs(o_current->picture->screen_lower_y -
- o_current->picture->screen_upper_y),
+ abs(s_lower_x - s_upper_x),
+ abs(s_lower_y - s_upper_y),
GDK_INTERP_BILINEAR);
g_object_unref(temp_pixbuf2);
@@ -428,13 +428,11 @@
if (w_current->DONT_REDRAW == 0) {
gdk_draw_pixbuf(w_current->window, w_current->gc,
o_current->picture->displayed_picture,
- 0, 0, o_current->picture->screen_upper_x,
- o_current->picture->screen_upper_y,
+ 0, 0, s_upper_x, s_upper_y,
-1, -1, GDK_RGB_DITHER_NONE, 0, 0);
gdk_draw_pixbuf(w_current->backingstore, w_current->gc,
o_current->picture->displayed_picture,
- 0, 0, o_current->picture->screen_upper_x,
- o_current->picture->screen_upper_y,
+ 0, 0, s_upper_x, s_upper_y,
-1, -1, GDK_RGB_DITHER_NONE, 0, 0);
}
}
@@ -444,19 +442,13 @@
gdk_gc_set_foreground(w_current->gc,
x_get_color(w_current->background_color));
gdk_draw_rectangle(w_current->window, w_current->gc, TRUE,
- o_current->picture->screen_upper_x,
- o_current->picture->screen_upper_y,
- abs(o_current->picture->screen_lower_x -
- o_current->picture->screen_upper_x),
- abs(o_current->picture->screen_lower_y -
- o_current->picture->screen_upper_y));
+ s_upper_x, s_upper_y,
+ abs(s_lower_x - s_upper_x),
+ abs(s_lower_y - s_upper_y));
gdk_draw_rectangle(w_current->backingstore, w_current->gc, TRUE,
- o_current->picture->screen_upper_x,
- o_current->picture->screen_upper_y,
- abs(o_current->picture->screen_lower_x -
- o_current->picture->screen_upper_x),
- abs(o_current->picture->screen_lower_y -
- o_current->picture->screen_upper_y));
+ s_upper_x, s_upper_y,
+ abs(s_lower_x -s_upper_x),
+ abs(s_lower_y - s_upper_y));
}
}
@@ -487,47 +479,41 @@
*/
void o_picture_draw_grips(TOPLEVEL *w_current, OBJECT *o_current)
{
+ int s_upper_x, s_upper_y, s_lower_x, s_lower_y;
+
#if DEBUG
printf("o_picture_draw_grips called\n");
#endif
if (w_current->draw_grips == FALSE)
return;
+ WORLDtoSCREEN( w_current, o_current->picture->upper_x, o_current->picture->upper_y,
+ &s_upper_x, &s_upper_y );
+ WORLDtoSCREEN( w_current, o_current->picture->lower_x, o_current->picture->lower_y,
+ &s_lower_x, &s_lower_y );
+
+
/* grip on upper left corner (whichone = PICTURE_UPPER_LEFT) */
- o_grips_draw(w_current,
- o_current->picture->screen_upper_x,
- o_current->picture->screen_upper_y);
+ o_grips_draw(w_current, s_upper_x, s_upper_y);
/* grip on upper right corner (whichone = PICTURE_UPPER_RIGHT) */
- o_grips_draw(w_current,
- o_current->picture->screen_lower_x,
- o_current->picture->screen_upper_y);
+ o_grips_draw(w_current, s_lower_x, s_upper_y);
/* grip on lower left corner (whichone = PICTURE_LOWER_LEFT) */
- o_grips_draw(w_current,
- o_current->picture->screen_upper_x,
- o_current->picture->screen_lower_y);
+ o_grips_draw(w_current, s_upper_x, s_lower_y);
/* grip on lower right corner (whichone = PICTURE_LOWER_RIGHT) */
- o_grips_draw(w_current,
- o_current->picture->screen_lower_x,
- o_current->picture->screen_lower_y);
+ o_grips_draw(w_current, s_lower_x, s_lower_y);
/* Box surrounding the picture */
gdk_draw_rectangle(w_current->window, w_current->gc, FALSE,
- o_current->picture->screen_upper_x,
- o_current->picture->screen_upper_y,
- abs(o_current->picture->screen_upper_x -
- o_current->picture->screen_lower_x),
- abs(o_current->picture->screen_upper_y -
- o_current->picture->screen_lower_y));
+ s_upper_x, s_upper_y,
+ abs(s_upper_x - s_lower_x),
+ abs(s_upper_y - s_lower_y));
gdk_draw_rectangle(w_current->backingstore, w_current->gc, FALSE,
- o_current->picture->screen_upper_x,
- o_current->picture->screen_upper_y,
- abs(o_current->picture->screen_upper_x -
- o_current->picture->screen_lower_x),
- abs(o_current->picture->screen_upper_y -
- o_current->picture->screen_lower_y));
+ s_upper_x, s_upper_y,
+ abs(s_upper_x - s_lower_x),
+ abs(s_upper_y - s_lower_y));
}
/*! \brief Erase grip marks from box.
@@ -540,47 +526,41 @@
*/
void o_picture_erase_grips(TOPLEVEL *w_current, OBJECT *o_current)
{
+ int s_upper_x, s_upper_y, s_lower_x, s_lower_y;
+
#if DEBUG
printf("o_picture_erase_grips called\n");
#endif
if (w_current->draw_grips == FALSE)
return;
+ WORLDtoSCREEN( w_current, o_current->picture->upper_x, o_current->picture->upper_y,
+ &s_upper_x, &s_upper_y );
+ WORLDtoSCREEN( w_current, o_current->picture->lower_x, o_current->picture->lower_y,
+ &s_lower_x, &s_lower_y );
+
/* grip on upper left corner (whichone = PICTURE_UPPER_LEFT) */
- o_grips_erase(w_current,
- o_current->picture->screen_upper_x,
- o_current->picture->screen_upper_y);
+ o_grips_erase(w_current, s_upper_x, s_upper_y);
/* grip on upper right corner (whichone = PICTURE_UPPER_RIGHT) */
- o_grips_erase(w_current,
- o_current->picture->screen_lower_x,
- o_current->picture->screen_upper_y);
+ o_grips_erase(w_current, s_lower_x, s_upper_y);
/* grip on lower left corner (whichone = PICTURE_LOWER_LEFT) */
- o_grips_erase(w_current,
- o_current->picture->screen_upper_x,
- o_current->picture->screen_lower_y);
+ o_grips_erase(w_current, s_upper_x, s_lower_y);
/* grip on lower right corner (whichone = PICTURE_LOWER_RIGHT) */
- o_grips_erase(w_current,
- o_current->picture->screen_lower_x,
- o_current->picture->screen_lower_y);
+ o_grips_erase(w_current, s_lower_x, s_lower_y);
/* Box surrounding the picture */
gdk_draw_rectangle(w_current->window, w_current->gc, FALSE,
- o_current->picture->screen_upper_x,
- o_current->picture->screen_upper_y,
- abs(o_current->picture->screen_upper_x -
- o_current->picture->screen_lower_x),
- abs(o_current->picture->screen_upper_y -
- o_current->picture->screen_lower_y));
+ s_upper_x, s_upper_y,
+ abs(s_upper_x - s_lower_x),
+ abs(s_upper_y - s_lower_y));
gdk_draw_rectangle(w_current->backingstore, w_current->gc, FALSE,
- o_current->picture->screen_upper_x,
- o_current->picture->screen_upper_y,
- abs(o_current->picture->screen_upper_x -
- o_current->picture->screen_lower_x),
- abs(o_current->picture->screen_upper_y -
- o_current->picture->screen_lower_y));
+ s_upper_x, s_upper_y,
+ abs(s_upper_x - s_lower_x),
+ abs(s_upper_y - s_lower_y));
+
}
/*! \brief Erase a picture described by OBJECT.
@@ -634,10 +614,10 @@
return;
}
- screen_x1 = o_current->picture->screen_upper_x;
- screen_y1 = o_current->picture->screen_upper_y;
- screen_x2 = o_current->picture->screen_lower_x;
- screen_y2 = o_current->picture->screen_lower_y;
+ WORLDtoSCREEN( w_current, o_current->picture->upper_x, o_current->picture->upper_y,
+ &screen_x1, &screen_y1 );
+ WORLDtoSCREEN( w_current, o_current->picture->lower_x, o_current->picture->lower_y,
+ &screen_x2, &screen_y2 );
if (o_current->saved_color != -1) {
color = o_current->saved_color;
1.25 +6 -4 eda/geda/gaf/gschem/src/o_pin.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_pin.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_pin.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -b -r1.24 -r1.25
--- o_pin.c 21 Oct 2006 13:56:26 -0000 1.24
+++ o_pin.c 24 Feb 2007 18:43:14 -0000 1.25
@@ -132,6 +132,7 @@
{
int size;
int color;
+ int sx[2], sy[2];
if (o_current->line == NULL) {
return;
@@ -153,11 +154,12 @@
GDK_JOIN_MITER);
}
+ WORLDtoSCREEN( w_current, o_current->line->x[0], o_current->line->y[0], &sx[0], &sy[0] );
+ WORLDtoSCREEN( w_current, o_current->line->x[1], o_current->line->y[1], &sx[1], &sy[1] );
+
gdk_draw_line(w_current->window, w_current->xor_gc,
- o_current->line->screen_x[0]+dx,
- o_current->line->screen_y[0]+dy,
- o_current->line->screen_x[1]+dx,
- o_current->line->screen_y[1]+dy);
+ sx[0]+dx, sy[0]+dy,
+ sx[1]+dx, sy[1]+dy);
if (w_current->pin_style == THICK ) {
gdk_gc_set_line_attributes(w_current->xor_gc, 0,
1.8 +4 -0 eda/geda/gaf/gschem/src/o_select.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_select.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_select.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- o_select.c 21 Dec 2006 20:11:11 -0000 1.7
+++ o_select.c 24 Feb 2007 18:43:14 -0000 1.8
@@ -388,6 +388,7 @@
OBJECT *o_current=NULL;
int count = 0; /* object count */
int SHIFTKEY = w_current->SHIFTKEY;
+ int w_start_x, w_start_y, w_last_x, w_last_y;
int tmp;
@@ -403,6 +404,9 @@
w_current->start_y = tmp;
}
+ SCREENtoWORLD( w_current, w_current->start_x, w_current->start_y, &w_start_x, &w_start_y );
+ SCREENtoWORLD( w_current, w_current->last_x, w_current->last_y, &w_last_x, &w_last_y );
+
o_current = w_current->page_current->object_head;
while (o_current != NULL) {
1.28 +13 -15 eda/geda/gaf/gschem/src/o_text.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_text.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_text.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -b -r1.27 -r1.28
--- o_text.c 21 Dec 2006 20:11:11 -0000 1.27
+++ o_text.c 24 Feb 2007 18:43:14 -0000 1.28
@@ -98,8 +98,7 @@
/* text is too small so go through and draw a rectangle in
it's place */
- screen_x1 = o_current->text->screen_x;
- screen_y1 = o_current->text->screen_y;
+ WORLDtoSCREEN( w_current, o_current->text->x, o_current->text->y, &screen_x1, &screen_y1 );
if (w_current->override_color != -1 ) { /* Override */
color = x_get_color(w_current->override_color);
@@ -233,8 +232,9 @@
offset = SCREENabs(w_current, 10);
small_dist = SCREENabs(w_current, 20);
- screen_x1 = o_current->text->screen_x + offset;
- screen_y1 = o_current->text->screen_y + offset;
+ WORLDtoSCREEN( w_current, o_current->text->x, o_current->text->y, &screen_x1, &screen_y1 );
+ screen_x1 += offset;
+ screen_y1 += offset;
if (w_current->DONT_REDRAW == 0) {
/* Top part of the I */
gdk_draw_line(w_current->window, w_current->gc,
@@ -286,8 +286,7 @@
small_dist = SCREENabs(w_current, 10);
- screen_x1 = o_current->text->screen_x;
- screen_y1 = o_current->text->screen_y;
+ WORLDtoSCREEN( w_current, o_current->text->x, o_current->text->y, &screen_x1, &screen_y1 );
/* this is not really a fix, but a lame patch */
/* not having this will cause a bad draw of things when coords */
@@ -367,8 +366,7 @@
/* text is too small so go through and draw a line in
it's place */
- screen_x1 = o_current->text->screen_x;
- screen_y1 = o_current->text->screen_y;
+ WORLDtoSCREEN( w_current, o_current->text->x, o_current->text->y, &screen_x1, &screen_y1 );
if (o_current->saved_color != -1) {
color = o_current->saved_color;
@@ -730,22 +728,22 @@
void o_text_place_rotate(TOPLEVEL *w_current)
{
OBJECT *o_current;
- int screen_x_local = -1;
- int screen_y_local = -1;
+ int x_local = -1;
+ int y_local = -1;
int new_angle;
o_current = w_current->page_current->attrib_place_head->next;
while(o_current) {
switch(o_current->type) {
case(OBJ_TEXT):
- screen_x_local = o_current->text->screen_x;
- screen_y_local = o_current->text->screen_y;
+ x_local = o_current->text->x;
+ y_local = o_current->text->y;
break;
}
o_current = o_current->next;
}
- if (screen_x_local == -1) {
+ if (x_local == -1) {
printf("Could not find text obj in new text placement!\n");
return;
}
@@ -756,7 +754,7 @@
case(OBJ_TEXT):
new_angle = (o_current->text->angle + 90) % 360;
- o_text_rotate(w_current, screen_x_local, screen_y_local,
+ o_text_rotate_world(w_current, x_local, y_local,
new_angle, 90, o_current);
break;
}
1.9 +2 -0 eda/geda/gaf/gschem/src/x_attribedit.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: x_attribedit.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/x_attribedit.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- x_attribedit.c 11 Feb 2007 07:39:50 -0000 1.8
+++ x_attribedit.c 24 Feb 2007 18:43:14 -0000 1.9
@@ -230,6 +230,8 @@
#endif
if (invocation_flag == FROM_HOTKEY) {
SCREENtoWORLD(w_current, mouse_x, mouse_y, &world_x, &world_y);
+ world_x = snap_grid(w_current, world_x);
+ world_y = snap_grid(w_current, world_y);
new->text->x = world_x;
new->text->y = world_y;
o_text_erase(w_current, new);
1.80 +3 -4 eda/geda/gaf/gschem/src/x_dialog.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: x_dialog.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/x_dialog.c,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -b -r1.79 -r1.80
--- x_dialog.c 24 Feb 2007 12:17:44 -0000 1.79
+++ x_dialog.c 24 Feb 2007 18:43:14 -0000 1.80
@@ -763,7 +763,6 @@
width,
length,
space);
- o_object_recalc (toplevel, o_current);
o_redraw_single (toplevel, o_current);
} else {
@@ -791,7 +790,6 @@
width == -1 ? o_current->line_width : width,
length == -1 ? o_current->line_length : length,
space == -1 ? o_current->line_space : space);
- o_object_recalc (toplevel, o_current);
o_redraw_single (toplevel, o_current);
object = object->next;
@@ -1136,7 +1134,6 @@
type, width,
pitch1, angle1,
pitch2, angle2);
- o_object_recalc (toplevel, o_current);
o_redraw_single (toplevel, o_current);
} else {
@@ -1169,7 +1166,6 @@
angle1 == -1 ? o_current->fill_angle1 : angle1,
pitch2 == -1 ? o_current->fill_pitch2 : pitch2,
angle2 == -1 ? o_current->fill_angle2 : angle2);
- o_object_recalc (toplevel, o_current);
o_redraw_single (toplevel, o_current);
object = object->next;
@@ -2001,6 +1997,9 @@
g_free(string);
SCREENtoWORLD(w_current, x, y, &world_x, &world_y);
+ /* TODO: Do we want to snap the coordinate display? */
+ world_x = snap_grid(w_current, world_x);
+ world_y = snap_grid(w_current, world_y);
string = g_strdup_printf("(%d, %d)", world_x, world_y);
gtk_label_set_text(GTK_LABEL(w_current->coord_world), string );
1.45 +26 -8 eda/geda/gaf/gschem/src/x_event.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: x_event.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/x_event.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -b -r1.44 -r1.45
--- x_event.c 24 Feb 2007 11:47:35 -0000 1.44
+++ x_event.c 24 Feb 2007 18:43:14 -0000 1.45
@@ -151,6 +151,7 @@
TOPLEVEL *w_current)
{
int prev_state;
+ int w_x, w_y;
exit_if_null(w_current);
global_window_current = w_current;
@@ -430,10 +431,18 @@
case(ENDROTATEP):
prev_state = w_current->DONT_REDRAW;
w_current->DONT_REDRAW = 0;
- o_rotate_90(
+
+ SCREENtoWORLD( w_current,
+ (int) event->x,
+ (int) event->y,
+ &w_x, &w_y );
+ w_x = snap_grid(w_current, w_x);
+ w_y = snap_grid(w_current, w_y);
+
+ o_rotate_90_world(
w_current,
w_current->page_current->selection_list,
- (int) event->x, (int) event->y);
+ w_x, w_y);
w_current->DONT_REDRAW = prev_state;
w_current->inside_action = 0;
@@ -442,9 +451,15 @@
break;
case(ENDMIRROR):
- o_mirror(w_current,
+ SCREENtoWORLD( w_current,
+ (int) event->x,
+ (int) event->y,
+ &w_x, &w_y );
+ o_mirror_world(w_current,
w_current->page_current->selection_list,
- (int) event->x, (int) event->y);
+ w_x, w_y);
+ w_x = snap_grid(w_current, w_x);
+ w_y = snap_grid(w_current, w_y);
w_current->inside_action = 0;
i_set_state(w_current, SELECT);
@@ -665,6 +680,7 @@
{
int prev_state;
int redraw_state;
+ int w_x, w_y;
exit_if_null(w_current);
global_window_current = w_current;
@@ -828,10 +844,12 @@
/* skip over head node */
redraw_state = w_current->DONT_REDRAW;
w_current->DONT_REDRAW = 1;
-
- o_rotate_90(w_current, w_current->page_current->complex_place_list,
- fix_x(w_current, w_current->start_x),
- fix_y(w_current, w_current->start_y));
+ SCREENtoWORLD( w_current,
+ w_current->start_x, w_current->start_y,
+ &w_x, &w_y );
+ w_x = snap_grid(w_current, w_x);
+ w_y = snap_grid(w_current, w_y);
+ o_rotate_90_world(w_current, w_current->page_current->complex_place_list, w_x, w_y );
w_current->DONT_REDRAW = redraw_state;
w_current->rotated_inside ++;
w_current->event_state = prev_state;
_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs