Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
9fb53f0c
Commit
9fb53f0c
authored
Mar 18, 2009
by
charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pcbnew: enhancement in printing function.
parent
3e477651
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
20 deletions
+25
-20
dialog_print_using_printer.cpp
pcbnew/dialog_print_using_printer.cpp
+19
-9
plothpgl.cpp
pcbnew/plothpgl.cpp
+1
-1
print_board_functions.cpp
pcbnew/print_board_functions.cpp
+5
-10
No files found.
pcbnew/dialog_print_using_printer.cpp
View file @
9fb53f0c
...
...
@@ -564,7 +564,7 @@ bool EDA_Printout::OnBeginDocument( int startPage, int endPage )
/*************************************************************/
{
if
(
!
wxPrintout
::
OnBeginDocument
(
startPage
,
endPage
)
)
return
FALSE
;
return
false
;
return
TRUE
;
}
...
...
@@ -699,11 +699,6 @@ void EDA_Printout::DrawPage()
g_IsPrinting
=
TRUE
;
int
bg_color
=
g_DrawBgColor
;
// background color can left BLACK only when drawing the full board at once, in color mode
// Switch it to WHITE in others cases
if
(
s_Print_Black_and_White
||
(
!
m_PrintFrame
->
PrintUsingSinglePage
()
)
)
g_DrawBgColor
=
WHITE
;
if
(
m_Print_Sheet_Ref
)
m_Parent
->
TraceWorkSheet
(
dc
,
ActiveScreen
,
0
);
...
...
@@ -748,14 +743,29 @@ void EDA_Printout::DrawPage()
s_PrintMaskLayer
|=
EDGE_LAYER
;
#endif
panel
->
PrintPage
(
dc
,
0
,
s_PrintMaskLayer
,
s_PrintMirror
);
g_DrawBgColor
=
WHITE
;
/* when printing in color mode, we use the graphic OR mode that gives the same look as the screen
* But because the backgroud is white when printing, we must use a trick:
* In order to plot on a white background in OR mode we must:
* 1 - Plot all items in black, this creates a local black backgroud
* 2 - Plot in OR mode on black "local" background
*/
if
(
!
s_Print_Black_and_White
)
{
GRForceBlackPen
(
true
);
panel
->
PrintPage
(
dc
,
0
,
s_PrintMaskLayer
,
s_PrintMirror
);
GRForceBlackPen
(
false
);
}
panel
->
PrintPage
(
dc
,
0
,
s_PrintMaskLayer
,
s_PrintMirror
);
g_DrawBgColor
=
bg_color
;
g_IsPrinting
=
FALSE
;
g_IsPrinting
=
false
;
panel
->
m_ClipBox
=
tmp
;
SetPenMinWidth
(
1
);
GRForceBlackPen
(
FALSE
);
GRForceBlackPen
(
false
);
ActiveScreen
->
m_StartVisu
=
tmp_startvisu
;
ActiveScreen
->
m_DrawOrg
=
old_org
;
...
...
pcbnew/plothpgl.cpp
View file @
9fb53f0c
...
...
@@ -432,7 +432,7 @@ void trace_1_pastille_OVALE_HPGL( wxPoint pos, wxSize size, int aOrient, int mod
if
(
modetrace
==
FILLED
)
{
PlotRectangularPad_HPGL
(
pos
,
wxSize
(
size
.
x
,
deltaxy
),
PlotRectangularPad_HPGL
(
pos
,
wxSize
(
size
.
x
,
deltaxy
+
pen_diam
),
aOrient
,
modetrace
);
cx
=
0
;
cy
=
deltaxy
/
2
;
RotatePoint
(
&
cx
,
&
cy
,
aOrient
);
...
...
pcbnew/print_board_functions.cpp
View file @
9fb53f0c
...
...
@@ -51,18 +51,13 @@ void WinEDA_DrawPanel::PrintPage( wxDC* aDC, bool aPrint_Sheet_Ref, int aPrintMa
m_PrintIsMirrored
=
aPrintMirrorMode
;
if
(
(
g_DrawBgColor
==
BLACK
)
&&
(
GetGRForceBlackPenState
(
)
==
false
)
)
{
// One can use the OR mode in this case, and we draw a black background to draw board in OR mode, like on screen
// But because black background are very expensive to draw, we draw in black only the minimun area.
// The OR mode is used in color mode, but be aware the backgroud *must be BLACK.
// In print page dialog, we first plrint in BLACK, and after reprint in color,
// on the black "local" backgroud, in OR mode
// the black print is not made before, only a white page is printed
if
(
GetGRForceBlackPenState
(
)
==
false
)
drawmode
=
GR_OR
;
EDA_Rect
rect
=
frame
->
GetBoard
()
->
m_BoundaryBox
;
rect
.
Inflate
(
2000
,
2000
);
// Margin in 1/10000 inch around the board to draw the black background.
GRSetDrawMode
(
aDC
,
GR_COPY
);
// draw in black the minimum page area:
GRFilledRect
(
&
m_ClipBox
,
aDC
,
rect
.
GetX
(),
rect
.
GetY
(),
rect
.
GetEnd
().
x
,
rect
.
GetEnd
().
y
,
g_DrawBgColor
,
g_DrawBgColor
);
}
/* Print the pcb graphic items (texts, ...) */
GRSetDrawMode
(
aDC
,
drawmode
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment