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
32db0d46
Commit
32db0d46
authored
Jul 08, 2013
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dynamic font scaling for pads netnames.
parent
b7747bc2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
pcb_painter.cpp
pcbnew/pcb_painter.cpp
+6
-4
pcb_painter.h
pcbnew/pcb_painter.h
+1
-1
No files found.
pcbnew/pcb_painter.cpp
View file @
32db0d46
...
...
@@ -374,12 +374,14 @@ void PCB_PAINTER::draw( const D_PAD* aPad, int aLayer )
if
(
aLayer
==
ITEM_GAL_LAYER
(
PADS_NETNAMES_VISIBLE
)
)
{
size
=
VECTOR2D
(
aPad
->
GetSize
()
/
2
);
double
scale
=
m_gal
->
GetZoomFactor
();
double
maxSize
=
PCB_RENDER_SETTINGS
::
MAX_FONT_SIZE
/
scale
;
// Font size limits
if
(
size
.
x
>
PCB_RENDER_SETTINGS
::
MAX_FONT_SIZE
)
size
.
x
=
PCB_RENDER_SETTINGS
::
MAX_FONT_SIZE
;
if
(
size
.
y
>
PCB_RENDER_SETTINGS
::
MAX_FONT_SIZE
)
size
.
y
=
PCB_RENDER_SETTINGS
::
MAX_FONT_SIZE
;
if
(
size
.
x
>
maxSize
)
size
.
x
=
maxSize
;
if
(
size
.
y
>
maxSize
)
size
.
y
=
maxSize
;
// Keep the size ratio for the font, but make it smaller
if
(
size
.
x
<
size
.
y
)
...
...
pcbnew/pcb_painter.h
View file @
32db0d46
...
...
@@ -105,7 +105,7 @@ protected:
bool
m_visibleLayers
[
NB_LAYERS
];
bool
m_visibleItems
[
END_PCB_VISIBLE_LIST
];
static
const
double
MAX_FONT_SIZE
=
1
5
00000
;
static
const
double
MAX_FONT_SIZE
=
1
000
00000
;
DisplayZonesMode
m_displayZoneMode
;
};
...
...
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