[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: branch: stable-1.4 updated (1.4.0-20080127-2-g5bc18e2)
The branch, stable-1.4 has been updated
via 5bc18e253307f2b8177dbebf5896672f401512be (commit)
from 7737ec1544d967202bdd425792795d00918897f2 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
gschem/src/o_net.c | 77 +++++++++++++++++++++++++++++++++++-----------------
1 files changed, 52 insertions(+), 25 deletions(-)
=================
Commit Messages
=================
commit 5bc18e253307f2b8177dbebf5896672f401512be
Author: Werner Hoch <werner.ho@xxxxxx>
Date: Fri Mar 7 19:02:19 2008 +0100
Fix drawing artefact in rubbernet drawing code
This commit is a backport of 24f0395aab9589f8e98f284e63fe77e6dc2d2836
The invalidation rectangles are to small if you're zoomed in.
The half of the net width needs to be added to the rectangels.
To do that, you have to sort the rectangle borders.
:100644 100644 20154fc... 84e0fdd... M gschem/src/o_net.c
=========
Changes
=========
commit 5bc18e253307f2b8177dbebf5896672f401512be
Author: Werner Hoch <werner.ho@xxxxxx>
Date: Fri Mar 7 19:02:19 2008 +0100
Fix drawing artefact in rubbernet drawing code
This commit is a backport of 24f0395aab9589f8e98f284e63fe77e6dc2d2836
The invalidation rectangles are to small if you're zoomed in.
The half of the net width needs to be added to the rectangels.
To do that, you have to sort the rectangle borders.
diff --git a/gschem/src/o_net.c b/gschem/src/o_net.c
index 20154fc..84e0fdd 100644
--- a/gschem/src/o_net.c
+++ b/gschem/src/o_net.c
@@ -252,7 +252,7 @@ void o_net_draw_xor_single(GSCHEM_TOPLEVEL *w_current, int dx, int dy, int which
void o_net_start(GSCHEM_TOPLEVEL *w_current, int x, int y)
{
TOPLEVEL *toplevel = w_current->toplevel;
- int size;
+ int size=0;
/* initalize all parameters used when drawing the new net */
w_current->last_x = w_current->start_x = w_current->second_x =
@@ -273,8 +273,12 @@ void o_net_start(GSCHEM_TOPLEVEL *w_current, int x, int y)
gdk_draw_line(w_current->backingstore, w_current->xor_gc,
w_current->start_x, w_current->start_y,
w_current->last_x, w_current->last_y);
- o_invalidate_rect(w_current, w_current->start_x, w_current->start_y,
- w_current->last_x, w_current->last_y);
+ o_invalidate_rect(w_current,
+ min(w_current->start_x, w_current->last_x) - size/2,
+ min(w_current->start_y, w_current->last_y) - size/2,
+ max(w_current->start_x, w_current->last_x) + size/2,
+ max(w_current->start_y, w_current->last_y) + size/2);
+
if (toplevel->net_style == THICK ) {
gdk_gc_set_line_attributes(w_current->xor_gc, 0,
GDK_LINE_SOLID,
@@ -329,16 +333,21 @@ int o_net_end(GSCHEM_TOPLEVEL *w_current, int x, int y)
gdk_draw_line(w_current->backingstore, w_current->xor_gc,
w_current->start_x, w_current->start_y,
w_current->last_x, w_current->last_y);
- o_invalidate_rect(w_current, w_current->start_x, w_current->start_y,
- w_current->last_x, w_current->last_y);
-
+ o_invalidate_rect(w_current,
+ min(w_current->start_x, w_current->last_x) - size/2,
+ min(w_current->start_y, w_current->last_y) - size/2,
+ max(w_current->start_x, w_current->last_x) + size/2,
+ max(w_current->start_y, w_current->last_y) + size/2);
/* Erase secondary rubber net line */
gdk_draw_line(w_current->backingstore, w_current->xor_gc,
w_current->last_x, w_current->last_y,
w_current->second_x, w_current->second_y);
- o_invalidate_rect(w_current, w_current->last_x, w_current->last_y,
- w_current->second_x, w_current->second_y);
+ o_invalidate_rect(w_current,
+ min(w_current->last_x, w_current->second_x) - size/2,
+ min(w_current->last_y, w_current->second_y) - size/2,
+ max(w_current->last_x, w_current->second_x) + size/2,
+ max(w_current->last_y, w_current->second_y) + size/2);
if (toplevel->net_style == THICK) {
gdk_gc_set_line_attributes(w_current->xor_gc, 0,
@@ -526,7 +535,7 @@ void o_net_rubbernet(GSCHEM_TOPLEVEL *w_current, int x, int y)
{
TOPLEVEL *toplevel = w_current->toplevel;
int diff_x, diff_y;
- int size;
+ int size=0;
int ortho;
g_assert( w_current->inside_action != 0 );
@@ -547,16 +556,22 @@ void o_net_rubbernet(GSCHEM_TOPLEVEL *w_current, int x, int y)
gdk_draw_line(w_current->backingstore, w_current->xor_gc,
w_current->start_x, w_current->start_y,
w_current->last_x, w_current->last_y);
- o_invalidate_rect(w_current, w_current->start_x, w_current->start_y,
- w_current->last_x, w_current->last_y);
+ o_invalidate_rect(w_current,
+ min(w_current->start_x, w_current->last_x) - size/2,
+ min(w_current->start_y, w_current->last_y) - size/2,
+ max(w_current->start_x, w_current->last_x) + size/2,
+ max(w_current->start_y, w_current->last_y) + size/2);
/* Erase secondary line*/
if ( w_current->second_x != -1 && w_current->second_y != -1 ) {
- gdk_draw_line(w_current->backingstore, w_current->xor_gc,
- w_current->last_x, w_current->last_y,
- w_current->second_x, w_current->second_y);
- o_invalidate_rect(w_current, w_current->last_x, w_current->last_y,
- w_current->second_x, w_current->second_y);
+ gdk_draw_line(w_current->backingstore, w_current->xor_gc,
+ w_current->last_x, w_current->last_y,
+ w_current->second_x, w_current->second_y);
+ o_invalidate_rect(w_current,
+ min(w_current->last_x, w_current->second_x) - size/2,
+ min(w_current->last_y, w_current->second_y) - size/2,
+ max(w_current->last_x, w_current->second_x) + size/2,
+ max(w_current->last_y, w_current->second_y) + size/2);
}
/* In orthogonal mode secondary line is the same as the first */
@@ -594,15 +609,21 @@ void o_net_rubbernet(GSCHEM_TOPLEVEL *w_current, int x, int y)
gdk_draw_line(w_current->backingstore, w_current->xor_gc,
w_current->start_x, w_current->start_y,
w_current->last_x, w_current->last_y);
- o_invalidate_rect(w_current, w_current->start_x, w_current->start_y,
- w_current->last_x, w_current->last_y);
+ o_invalidate_rect(w_current,
+ min(w_current->start_x, w_current->last_x) - size/2,
+ min(w_current->start_y, w_current->last_y) - size/2,
+ max(w_current->start_x, w_current->last_x) + size/2,
+ max(w_current->start_y, w_current->last_y) + size/2);
/* Draw secondary line */
gdk_draw_line(w_current->backingstore, w_current->xor_gc,
w_current->last_x, w_current->last_y,
w_current->second_x, w_current->second_y);
- o_invalidate_rect(w_current, w_current->last_x, w_current->last_y,
- w_current->second_x, w_current->second_y);
+ o_invalidate_rect(w_current,
+ min(w_current->last_x, w_current->second_x) - size/2,
+ min(w_current->last_y, w_current->second_y) - size/2,
+ max(w_current->last_x, w_current->second_x) + size/2,
+ max(w_current->last_y, w_current->second_y) + size/2);
if (toplevel->net_style == THICK) {
gdk_gc_set_line_attributes(w_current->xor_gc, 0,
@@ -621,7 +642,7 @@ void o_net_rubbernet(GSCHEM_TOPLEVEL *w_current, int x, int y)
void o_net_eraserubber(GSCHEM_TOPLEVEL *w_current)
{
TOPLEVEL *toplevel = w_current->toplevel;
- int size;
+ int size=0;
if (toplevel->net_style == THICK) {
size = SCREENabs(toplevel, NET_WIDTH);
@@ -637,15 +658,21 @@ void o_net_eraserubber(GSCHEM_TOPLEVEL *w_current)
/* Erase primary primary rubber net line */
gdk_draw_line(w_current->backingstore, w_current->xor_gc, w_current->start_x,
w_current->start_y, w_current->last_x, w_current->last_y);
- o_invalidate_rect(w_current, w_current->start_x, w_current->start_y,
- w_current->last_x, w_current->last_y);
+ o_invalidate_rect(w_current,
+ min(w_current->start_x, w_current->last_x) - size/2,
+ min(w_current->start_y, w_current->last_y) - size/2,
+ max(w_current->start_x, w_current->last_x) + size/2,
+ max(w_current->start_y, w_current->last_y) + size/2);
/* Erase secondary rubber net line */
gdk_draw_line(w_current->backingstore, w_current->xor_gc,
w_current->last_x, w_current->last_y,
w_current->second_x, w_current->second_y);
- o_invalidate_rect(w_current, w_current->last_x, w_current->last_y,
- w_current->second_x, w_current->second_y);
+ o_invalidate_rect(w_current,
+ min(w_current->last_x, w_current->second_x) - size/2,
+ min(w_current->last_y, w_current->second_y) - size/2,
+ max(w_current->last_x, w_current->second_x) + size/2,
+ max(w_current->last_y, w_current->second_y) + size/2);
if (toplevel->net_style == THICK) {
gdk_gc_set_line_attributes(w_current->xor_gc, 0,
_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs