[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: pcb.git: branch: master updated (f691333a25c36913415006a4f668cc2af05b0090)
The branch, master has been updated
via f691333a25c36913415006a4f668cc2af05b0090 (commit)
via aa4931e9b2b2b9a217f47026a6d556d02d85ebb3 (commit)
from 55210469f88f6e070e67341fcfa7d9183223d721 (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
=========
src/draw.c | 50 ++++++++++++++++++++------------------------------
1 files changed, 20 insertions(+), 30 deletions(-)
=================
Commit Messages
=================
commit f691333a25c36913415006a4f668cc2af05b0090
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
draw.c: Fix mask drawing at high zooms (only draw the bit on-screen)
This probably papers over a bug in the GTK hid's fill_rect routine, as the
only reason this should fix anything is because it avoids coordinate overflow
at high zoom.
The GTK hid really ought to clip coords to the screen before transforming them
for rendering.
:100644 100644 252c157... c91a37e... M src/draw.c
commit aa4931e9b2b2b9a217f47026a6d556d02d85ebb3
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
draw.c: Tidy up mask drawing code
Since the gerber HID now supports putting the outline on various layers,
we can also safely remove the commented out code for doing that in draw.c
:100644 100644 18d0dce... 252c157... M src/draw.c
=========
Changes
=========
commit f691333a25c36913415006a4f668cc2af05b0090
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
draw.c: Fix mask drawing at high zooms (only draw the bit on-screen)
This probably papers over a bug in the GTK hid's fill_rect routine, as the
only reason this should fix anything is because it avoids coordinate overflow
at high zoom.
The GTK hid really ought to clip coords to the screen before transforming them
for rendering.
diff --git a/src/draw.c b/src/draw.c
index 252c157..c91a37e 100644
--- a/src/draw.c
+++ b/src/draw.c
@@ -735,7 +735,7 @@ DrawSilk (int new_swap, int layer, const BoxType * drawn_area)
static void
-DrawMaskBoardArea (int mask_type)
+DrawMaskBoardArea (int mask_type, BoxType *screen)
{
/* Skip the mask drawing if the GUI doesn't want this type */
if ((mask_type == HID_MASK_BEFORE && !gui->poly_before) ||
@@ -744,7 +744,11 @@ DrawMaskBoardArea (int mask_type)
gui->use_mask (mask_type);
gui->set_color (Output.fgGC, PCB->MaskColor);
- gui->fill_rect (Output.fgGC, 0, 0, PCB->MaxWidth, PCB->MaxHeight);
+ if (screen == NULL)
+ gui->fill_rect (Output.fgGC, 0, 0, PCB->MaxWidth, PCB->MaxHeight);
+ else
+ gui->fill_rect (Output.fgGC, screen->X1, screen->Y1,
+ screen->X2, screen->Y2);
}
/* ---------------------------------------------------------------------------
@@ -762,7 +766,7 @@ DrawMask (BoxType * screen)
gui->set_color (Output.pmGC, PCB->MaskColor);
else
{
- DrawMaskBoardArea (HID_MASK_BEFORE);
+ DrawMaskBoardArea (HID_MASK_BEFORE, screen);
gui->use_mask (HID_MASK_CLEAR);
}
@@ -774,7 +778,7 @@ DrawMask (BoxType * screen)
gui->set_color (Output.pmGC, "erase");
else
{
- DrawMaskBoardArea (HID_MASK_AFTER);
+ DrawMaskBoardArea (HID_MASK_AFTER, screen);
gui->use_mask (HID_MASK_OFF);
}
}
commit aa4931e9b2b2b9a217f47026a6d556d02d85ebb3
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
draw.c: Tidy up mask drawing code
Since the gerber HID now supports putting the outline on various layers,
we can also safely remove the commented out code for doing that in draw.c
diff --git a/src/draw.c b/src/draw.c
index 18d0dce..252c157 100644
--- a/src/draw.c
+++ b/src/draw.c
@@ -733,6 +733,20 @@ DrawSilk (int new_swap, int layer, const BoxType * drawn_area)
SWAP_IDENT = save_swap;
}
+
+static void
+DrawMaskBoardArea (int mask_type)
+{
+ /* Skip the mask drawing if the GUI doesn't want this type */
+ if ((mask_type == HID_MASK_BEFORE && !gui->poly_before) ||
+ (mask_type == HID_MASK_AFTER && !gui->poly_after))
+ return;
+
+ gui->use_mask (mask_type);
+ gui->set_color (Output.fgGC, PCB->MaskColor);
+ gui->fill_rect (Output.fgGC, 0, 0, PCB->MaxWidth, PCB->MaxHeight);
+}
+
/* ---------------------------------------------------------------------------
* draws solder mask layer - this will cover nearly everything
*/
@@ -742,20 +756,13 @@ DrawMask (BoxType * screen)
struct pin_info info;
int thin = TEST_FLAG(THINDRAWFLAG, PCB) || TEST_FLAG(THINDRAWPOLYFLAG, PCB);
- OutputType *out = &Output;
-
info.arg = true;
if (thin)
gui->set_color (Output.pmGC, PCB->MaskColor);
else
{
- if (gui->poly_before)
- {
- gui->use_mask (HID_MASK_BEFORE);
- gui->set_color (out->fgGC, PCB->MaskColor);
- gui->fill_rect (out->fgGC, 0, 0, PCB->MaxWidth, PCB->MaxHeight);
- }
+ DrawMaskBoardArea (HID_MASK_BEFORE);
gui->use_mask (HID_MASK_CLEAR);
}
@@ -767,30 +774,9 @@ DrawMask (BoxType * screen)
gui->set_color (Output.pmGC, "erase");
else
{
- if (gui->poly_after)
- {
- gui->use_mask (HID_MASK_AFTER);
- gui->set_color (out->fgGC, PCB->MaskColor);
- gui->fill_rect (out->fgGC, 0, 0, PCB->MaxWidth, PCB->MaxHeight);
- }
+ DrawMaskBoardArea (HID_MASK_AFTER);
gui->use_mask (HID_MASK_OFF);
}
-
-#if 0
- /* Some fabs want the board outline on the solder mask layer. If
- you need this, change the '0' above to '1', and the code below
- will copy the outline layer to the mask layers. */
- if (!gui->gui)
- {
- int i;
- for (i=PCB->Data->LayerN; i>=0; i--)
- {
- LayerTypePtr Layer = PCB->Data->Layer + i;
- if (strcmp (Layer->Name, "outline") == 0)
- DrawLayer (Layer, screen);
- }
- }
-#endif
}
static void
_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs