[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-user: [PATCH 4/4][PCB] Crosshair color update
Update crosshair logic so that the current "crosshair-color" value is
used. The original code would not update the "crosshair-color"
immediately after changing the "crosshair-color" preference setting.
Signed-off-by: Peter Tyser <ptyser@xxxxxxxxx>
---
src/crosshair.c | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/src/crosshair.c b/src/crosshair.c
index 8321929..3098d7b 100644
--- a/src/crosshair.c
+++ b/src/crosshair.c
@@ -583,6 +583,7 @@ DrawAttached (Boolean BlockToo)
switch (Settings.Mode)
{
case VIA_MODE:
+ gui->set_color (Crosshair.GC, Settings.CrosshairColor);
gui->draw_arc (Crosshair.GC,
Crosshair.X,
Crosshair.Y,
@@ -594,12 +595,13 @@ DrawAttached (Boolean BlockToo)
gui->set_color (Crosshair.GC, Settings.CrossColor);
gui->draw_arc (Crosshair.GC,
Crosshair.X, Crosshair.Y, s, s, 0, 360);
- gui->set_color (Crosshair.GC, Settings.CrosshairColor);
}
break;
/* the attached line is used by both LINEMODE and POLYGON_MODE */
case POLYGON_MODE:
+ gui->set_color (Crosshair.GC, Settings.CrosshairColor);
+
/* draw only if starting point is set */
if (Crosshair.AttachedLine.State != STATE_FIRST)
gui->draw_line (Crosshair.GC,
@@ -618,13 +620,13 @@ DrawAttached (Boolean BlockToo)
case ARC_MODE:
if (Crosshair.AttachedBox.State != STATE_FIRST)
{
+ gui->set_color (Crosshair.GC, Settings.CrosshairColor);
XORDrawAttachedArc (Settings.LineThickness);
if (TEST_FLAG (SHOWDRCFLAG, PCB))
{
gui->set_color (Crosshair.GC, Settings.CrossColor);
XORDrawAttachedArc (Settings.LineThickness +
2 * (PCB->Bloat + 1));
- gui->set_color (Crosshair.GC, Settings.CrosshairColor);
}
}
@@ -635,6 +637,7 @@ DrawAttached (Boolean BlockToo)
if (Crosshair.AttachedLine.State != STATE_FIRST &&
Crosshair.AttachedLine.draw)
{
+ gui->set_color (Crosshair.GC, Settings.CrosshairColor);
XORDrawAttachedLine (Crosshair.AttachedLine.Point1.X,
Crosshair.AttachedLine.Point1.Y,
Crosshair.AttachedLine.Point2.X,
@@ -661,7 +664,6 @@ DrawAttached (Boolean BlockToo)
Crosshair.X, Crosshair.Y,
PCB->RatDraw ? 10 : Settings.
LineThickness + 2 * (PCB->Bloat + 1));
- gui->set_color (Crosshair.GC, Settings.CrosshairColor);
}
}
break;
@@ -678,6 +680,10 @@ DrawAttached (Boolean BlockToo)
case INSERTPOINT_MODE:
XORDrawInsertPointObject ();
break;
+ case ARROW_MODE:
+ /* We're going to draw a selection rectangle */
+ case RECTANGLE_MODE:
+ gui->set_color (Crosshair.GC, Settings.CrosshairColor);
}
/* an attached box does not depend on a special mode */
--
1.6.2-rc2.GIT
_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user