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
0b7fd874
Commit
0b7fd874
authored
Mar 25, 2015
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed printing issues under Linux.
parent
ec8bf0c1
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
22 additions
and
46 deletions
+22
-46
gr_basic.cpp
common/gr_basic.cpp
+11
-12
worksheet.cpp
common/worksheet.cpp
+0
-1
gr_basic.h
include/gr_basic.h
+1
-1
class_pad_draw_functions.cpp
pcbnew/class_pad_draw_functions.cpp
+5
-8
class_zone.cpp
pcbnew/class_zone.cpp
+1
-1
print_board_functions.cpp
pcbnew/print_board_functions.cpp
+2
-21
printout_controler.cpp
pcbnew/printout_controler.cpp
+2
-2
No files found.
common/gr_basic.cpp
View file @
0b7fd874
...
@@ -207,15 +207,10 @@ void GRResetPenAndBrush( wxDC* DC )
...
@@ -207,15 +207,10 @@ void GRResetPenAndBrush( wxDC* DC )
*/
*/
void
GRSetColorPen
(
wxDC
*
DC
,
EDA_COLOR_T
Color
,
int
width
,
wxPenStyle
style
)
void
GRSetColorPen
(
wxDC
*
DC
,
EDA_COLOR_T
Color
,
int
width
,
wxPenStyle
style
)
{
{
if
(
width
<
0
)
// Under OSX and while printing when wxPen is set to 0, renderer follows the request drawing
width
=
0
;
// nothing & in the bitmap world the minimum is enough to light a pixel, in vectorial one not
#ifdef __WXMAC__
// Under OSX when wxPen is set to 0, cocoa follows the request drawing nothing &
// in the bitmap world the minimum is enough to light a pixel, in vectorial one not
if
(
width
<=
1
)
if
(
width
<=
1
)
width
=
DC
->
DeviceToLogicalXRel
(
1
);
width
=
DC
->
DeviceToLogicalXRel
(
1
);
#endif
if
(
s_ForceBlackPen
)
if
(
s_ForceBlackPen
)
{
{
...
@@ -341,7 +336,7 @@ void GRSetDrawMode( wxDC* DC, GR_DRAWMODE draw_mode )
...
@@ -341,7 +336,7 @@ void GRSetDrawMode( wxDC* DC, GR_DRAWMODE draw_mode )
DC
->
SetLogicalFunction
(
wxINVERT
);
DC
->
SetLogicalFunction
(
wxINVERT
);
#endif
#endif
else
else
if
(
draw_mode
&
GR_COPY
)
DC
->
SetLogicalFunction
(
wxCOPY
);
DC
->
SetLogicalFunction
(
wxCOPY
);
#ifdef USE_WX_OVERLAY
#ifdef USE_WX_OVERLAY
...
@@ -795,13 +790,17 @@ void GRFilledCircle( EDA_RECT* ClipBox, wxDC* DC, int x, int y, int r,
...
@@ -795,13 +790,17 @@ void GRFilledCircle( EDA_RECT* ClipBox, wxDC* DC, int x, int y, int r,
y0
=
ClipBox
->
GetY
();
y0
=
ClipBox
->
GetY
();
xm
=
ClipBox
->
GetRight
();
xm
=
ClipBox
->
GetRight
();
ym
=
ClipBox
->
GetBottom
();
ym
=
ClipBox
->
GetBottom
();
if
(
x
<
(
x0
-
r
)
)
if
(
x
<
(
x0
-
r
)
)
return
;
return
;
if
(
y
<
(
y0
-
r
)
)
if
(
y
<
(
y0
-
r
)
)
return
;
return
;
if
(
x
>
(
r
+
xm
)
)
if
(
x
>
(
r
+
xm
)
)
return
;
return
;
if
(
y
>
(
r
+
ym
)
)
if
(
y
>
(
r
+
ym
)
)
return
;
return
;
}
}
...
...
common/worksheet.cpp
View file @
0b7fd874
...
@@ -55,7 +55,6 @@ void DrawPageLayout( wxDC* aDC, EDA_RECT* aClipBox,
...
@@ -55,7 +55,6 @@ void DrawPageLayout( wxDC* aDC, EDA_RECT* aClipBox,
int
aPenWidth
,
double
aScalar
,
int
aPenWidth
,
double
aScalar
,
EDA_COLOR_T
aColor
,
EDA_COLOR_T
aAltColor
)
EDA_COLOR_T
aColor
,
EDA_COLOR_T
aAltColor
)
{
{
GRSetDrawMode
(
aDC
,
GR_COPY
);
WS_DRAW_ITEM_LIST
drawList
;
WS_DRAW_ITEM_LIST
drawList
;
drawList
.
SetPenSize
(
aPenWidth
);
drawList
.
SetPenSize
(
aPenWidth
);
...
...
include/gr_basic.h
View file @
0b7fd874
...
@@ -37,13 +37,13 @@ class EDA_RECT;
...
@@ -37,13 +37,13 @@ class EDA_RECT;
/// Drawmode. Compositing mode plus a flag or two
/// Drawmode. Compositing mode plus a flag or two
enum
GR_DRAWMODE
{
enum
GR_DRAWMODE
{
GR_COPY
=
0
,
GR_OR
=
0x01000000
,
GR_OR
=
0x01000000
,
GR_XOR
=
0x02000000
,
GR_XOR
=
0x02000000
,
GR_AND
=
0x04000000
,
GR_AND
=
0x04000000
,
GR_NXOR
=
0x08000000
,
GR_NXOR
=
0x08000000
,
GR_INVERT
=
0x10000000
,
GR_INVERT
=
0x10000000
,
GR_ALLOW_HIGHCONTRAST
=
0x20000000
,
GR_ALLOW_HIGHCONTRAST
=
0x20000000
,
GR_COPY
=
0x40000000
,
GR_HIGHLIGHT
=
0x80000000
,
GR_HIGHLIGHT
=
0x80000000
,
UNSPECIFIED_DRAWMODE
=
-
1
UNSPECIFIED_DRAWMODE
=
-
1
};
};
...
...
pcbnew/class_pad_draw_functions.cpp
View file @
0b7fd874
...
@@ -424,11 +424,10 @@ void D_PAD::DrawShape( EDA_RECT* aClipBox, wxDC* aDC, PAD_DRAWINFO& aDrawInfo )
...
@@ -424,11 +424,10 @@ void D_PAD::DrawShape( EDA_RECT* aClipBox, wxDC* aDC, PAD_DRAWINFO& aDrawInfo )
GRForceBlackPen
(
false
);
GRForceBlackPen
(
false
);
aDrawInfo
.
m_HoleColor
=
WHITE
;
aDrawInfo
.
m_HoleColor
=
WHITE
;
}
}
if
(
aDrawInfo
.
m_DrawMode
!=
GR_XOR
)
GRSetDrawMode
(
aDC
,
GR_COPY
);
else
else
GRSetDrawMode
(
aDC
,
GR_XOR
);
{
GRSetDrawMode
(
aDC
,
(
aDrawInfo
.
m_DrawMode
!=
GR_XOR
)
?
GR_COPY
:
GR_XOR
);
}
EDA_COLOR_T
hole_color
=
aDrawInfo
.
m_HoleColor
;
EDA_COLOR_T
hole_color
=
aDrawInfo
.
m_HoleColor
;
...
@@ -477,10 +476,8 @@ void D_PAD::DrawShape( EDA_RECT* aClipBox, wxDC* aDC, PAD_DRAWINFO& aDrawInfo )
...
@@ -477,10 +476,8 @@ void D_PAD::DrawShape( EDA_RECT* aClipBox, wxDC* aDC, PAD_DRAWINFO& aDrawInfo )
holepos
.
x
-
dx0
,
holepos
.
y
+
dx0
,
0
,
nc_color
);
holepos
.
x
-
dx0
,
holepos
.
y
+
dx0
,
0
,
nc_color
);
}
}
if
(
aDrawInfo
.
m_DrawMode
!=
GR_XOR
)
if
(
!
aDrawInfo
.
m_IsPrinting
)
GRSetDrawMode
(
aDC
,
GR_COPY
);
GRSetDrawMode
(
aDC
,
(
aDrawInfo
.
m_DrawMode
!=
GR_XOR
)
?
GR_COPY
:
GR_XOR
);
else
GRSetDrawMode
(
aDC
,
GR_XOR
);
// Draw the pad number
// Draw the pad number
if
(
!
aDrawInfo
.
m_Display_padnum
&&
!
aDrawInfo
.
m_Display_netname
)
if
(
!
aDrawInfo
.
m_Display_padnum
&&
!
aDrawInfo
.
m_Display_netname
)
...
...
pcbnew/class_zone.cpp
View file @
0b7fd874
...
@@ -308,7 +308,7 @@ void ZONE_CONTAINER::DrawFilledArea( EDA_DRAW_PANEL* panel,
...
@@ -308,7 +308,7 @@ void ZONE_CONTAINER::DrawFilledArea( EDA_DRAW_PANEL* panel,
}
}
// Draw areas:
// Draw areas:
if
(
m_FillMode
==
0
&&
!
outline_mode
)
if
(
m_FillMode
==
0
&&
!
outline_mode
)
GRPoly
(
panel
->
GetClipBox
(),
DC
,
CornersBuffer
.
size
(),
&
CornersBuffer
[
0
],
GRPoly
(
panel
->
GetClipBox
(),
DC
,
CornersBuffer
.
size
(),
&
CornersBuffer
[
0
],
true
,
0
,
color
,
color
);
true
,
0
,
color
,
color
);
}
}
...
...
pcbnew/print_board_functions.cpp
View file @
0b7fd874
...
@@ -50,7 +50,7 @@ void FOOTPRINT_EDIT_FRAME::PrintPage( wxDC* aDC,
...
@@ -50,7 +50,7 @@ void FOOTPRINT_EDIT_FRAME::PrintPage( wxDC* aDC,
bool
aPrintMirrorMode
,
bool
aPrintMirrorMode
,
void
*
aData
)
void
*
aData
)
{
{
GR_DRAWMODE
drawmode
=
GR_COPY
;
const
GR_DRAWMODE
drawmode
=
(
GR_DRAWMODE
)
0
;
int
defaultPenSize
=
Millimeter2iu
(
0.2
);
int
defaultPenSize
=
Millimeter2iu
(
0.2
);
DISPLAY_OPTIONS
*
displ_opts
=
(
DISPLAY_OPTIONS
*
)
GetDisplayOptions
();
DISPLAY_OPTIONS
*
displ_opts
=
(
DISPLAY_OPTIONS
*
)
GetDisplayOptions
();
...
@@ -81,13 +81,6 @@ void FOOTPRINT_EDIT_FRAME::PrintPage( wxDC* aDC,
...
@@ -81,13 +81,6 @@ void FOOTPRINT_EDIT_FRAME::PrintPage( wxDC* aDC,
m_canvas
->
SetPrintMirrored
(
aPrintMirrorMode
);
m_canvas
->
SetPrintMirrored
(
aPrintMirrorMode
);
// The OR mode is used in color mode, but be aware the background *must be
// BLACK. In the print page dialog, we first print in BLACK, and after
// reprint in color, on the black "local" background, in OR mode the black
// print is not made before, only a white page is printed
if
(
GetGRForceBlackPenState
()
==
false
)
drawmode
=
GR_OR
;
// Draw footprints, this is done at last in order to print the pad holes in
// Draw footprints, this is done at last in order to print the pad holes in
// white after the tracks and zones
// white after the tracks and zones
int
tmp
=
D_PAD
::
m_PadSketchModePenSize
;
int
tmp
=
D_PAD
::
m_PadSketchModePenSize
;
...
@@ -117,7 +110,7 @@ void PCB_EDIT_FRAME::PrintPage( wxDC* aDC,
...
@@ -117,7 +110,7 @@ void PCB_EDIT_FRAME::PrintPage( wxDC* aDC,
bool
aPrintMirrorMode
,
bool
aPrintMirrorMode
,
void
*
aData
)
void
*
aData
)
{
{
GR_DRAWMODE
drawmode
=
GR_COPY
;
const
GR_DRAWMODE
drawmode
=
(
GR_DRAWMODE
)
0
;
DISPLAY_OPTIONS
save_opt
;
DISPLAY_OPTIONS
save_opt
;
BOARD
*
Pcb
=
GetBoard
();
BOARD
*
Pcb
=
GetBoard
();
int
defaultPenSize
=
Millimeter2iu
(
0.2
);
int
defaultPenSize
=
Millimeter2iu
(
0.2
);
...
@@ -201,16 +194,6 @@ void PCB_EDIT_FRAME::PrintPage( wxDC* aDC,
...
@@ -201,16 +194,6 @@ void PCB_EDIT_FRAME::PrintPage( wxDC* aDC,
m_canvas
->
SetPrintMirrored
(
aPrintMirrorMode
);
m_canvas
->
SetPrintMirrored
(
aPrintMirrorMode
);
// The OR mode is used in color mode, but be aware the background *must be
// BLACK. In the print page dialog, we first print in BLACK, and after
// reprint in color, on the black "local" background, in OR mode the black
// print is not made before, only a white page is printed
if
(
GetGRForceBlackPenState
()
==
false
)
drawmode
=
GR_OR
;
// Print the pcb graphic items (texts, ...)
GRSetDrawMode
(
aDC
,
drawmode
);
for
(
BOARD_ITEM
*
item
=
Pcb
->
m_Drawings
;
item
;
item
=
item
->
Next
()
)
for
(
BOARD_ITEM
*
item
=
Pcb
->
m_Drawings
;
item
;
item
=
item
->
Next
()
)
{
{
switch
(
item
->
Type
()
)
switch
(
item
->
Type
()
)
...
@@ -242,7 +225,6 @@ void PCB_EDIT_FRAME::PrintPage( wxDC* aDC,
...
@@ -242,7 +225,6 @@ void PCB_EDIT_FRAME::PrintPage( wxDC* aDC,
EDA_COLOR_T
color
=
g_ColorsSettings
.
GetItemColor
(
VIAS_VISIBLE
+
via
->
GetViaType
()
);
EDA_COLOR_T
color
=
g_ColorsSettings
.
GetItemColor
(
VIAS_VISIBLE
+
via
->
GetViaType
()
);
GRSetDrawMode
(
aDC
,
drawmode
);
GRFilledCircle
(
m_canvas
->
GetClipBox
(),
aDC
,
GRFilledCircle
(
m_canvas
->
GetClipBox
(),
aDC
,
via
->
GetStart
().
x
,
via
->
GetStart
().
x
,
via
->
GetStart
().
y
,
via
->
GetStart
().
y
,
...
@@ -295,7 +277,6 @@ void PCB_EDIT_FRAME::PrintPage( wxDC* aDC,
...
@@ -295,7 +277,6 @@ void PCB_EDIT_FRAME::PrintPage( wxDC* aDC,
bool
blackpenstate
=
GetGRForceBlackPenState
();
bool
blackpenstate
=
GetGRForceBlackPenState
();
GRForceBlackPen
(
false
);
GRForceBlackPen
(
false
);
GRSetDrawMode
(
aDC
,
GR_COPY
);
for
(
;
track
;
track
=
track
->
Next
()
)
for
(
;
track
;
track
=
track
->
Next
()
)
{
{
...
...
pcbnew/printout_controler.cpp
View file @
0b7fd874
...
@@ -142,7 +142,7 @@ void BOARD_PRINTOUT_CONTROLLER::DrawPage()
...
@@ -142,7 +142,7 @@ void BOARD_PRINTOUT_CONTROLLER::DrawPage()
wxBusyCursor
dummy
;
wxBusyCursor
dummy
;
BOARD
*
brd
=
((
PCB_BASE_FRAME
*
)
m_Parent
)
->
GetBoard
();
BOARD
*
brd
=
((
PCB_BASE_FRAME
*
)
m_Parent
)
->
GetBoard
();
boardBoundingBox
=
brd
->
ComputeBoundingBox
();
boardBoundingBox
=
brd
->
ComputeBoundingBox
();
wxString
titleblockFilename
=
brd
->
GetFileName
();
wxString
titleblockFilename
=
brd
->
GetFileName
();
...
@@ -160,7 +160,7 @@ void BOARD_PRINTOUT_CONTROLLER::DrawPage()
...
@@ -160,7 +160,7 @@ void BOARD_PRINTOUT_CONTROLLER::DrawPage()
if
(
m_PrintParams
.
m_PrintScale
==
0
)
// fit in page option
if
(
m_PrintParams
.
m_PrintScale
==
0
)
// fit in page option
{
{
if
(
boardBoundingBox
.
GetWidth
()
&&
boardBoundingBox
.
GetHeight
()
)
if
(
boardBoundingBox
.
GetWidth
()
&&
boardBoundingBox
.
GetHeight
()
)
{
{
int
margin
=
Millimeter2iu
(
10.0
);
// add a margin around the drawings
int
margin
=
Millimeter2iu
(
10.0
);
// add a margin around the drawings
double
scaleX
=
(
double
)(
pageSizeIU
.
x
-
(
2
*
margin
))
/
double
scaleX
=
(
double
)(
pageSizeIU
.
x
-
(
2
*
margin
))
/
...
...
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