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
ca11855f
Commit
ca11855f
authored
Dec 05, 2013
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed std::wstring to wxString.
parent
7678983e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
13 deletions
+14
-13
stroke_font.cpp
common/gal/stroke_font.cpp
+9
-8
graphics_abstraction_layer.h
include/gal/graphics_abstraction_layer.h
+1
-1
stroke_font.h
include/gal/stroke_font.h
+2
-2
pcb_painter.cpp
pcbnew/pcb_painter.cpp
+2
-2
No files found.
common/gal/stroke_font.cpp
View file @
ca11855f
...
...
@@ -26,6 +26,7 @@
#include <gal/stroke_font.h>
#include <gal/graphics_abstraction_layer.h>
#include <wx/string.h>
using
namespace
KIGFX
;
...
...
@@ -142,7 +143,7 @@ BOX2D STROKE_FONT::computeBoundingBox( const GLYPH& aGLYPH, const VECTOR2D& aGLY
}
void
STROKE_FONT
::
Draw
(
std
::
ws
tring
aText
,
const
VECTOR2D
&
aPosition
,
double
aRotationAngle
)
void
STROKE_FONT
::
Draw
(
wxS
tring
aText
,
const
VECTOR2D
&
aPosition
,
double
aRotationAngle
)
{
// By default overbar is turned off
m_overbar
=
false
;
...
...
@@ -154,14 +155,14 @@ void STROKE_FONT::Draw( std::wstring aText, const VECTOR2D& aPosition, double aR
m_gal
->
Rotate
(
-
aRotationAngle
);
// Split multiline strings into separate ones and draw them line by line
size_t
newlinePos
=
aText
.
f
ind
(
'\n'
);
int
newlinePos
=
aText
.
F
ind
(
'\n'
);
if
(
newlinePos
!=
std
::
wstring
::
npos
)
if
(
newlinePos
!=
wxNOT_FOUND
)
{
VECTOR2D
nextlinePosition
=
VECTOR2D
(
0.0
,
m_glyphSize
.
y
*
LINE_HEIGHT_RATIO
);
Draw
(
aText
.
substr
(
newlinePos
+
1
),
nextlinePosition
,
0.0
);
aText
=
aText
.
substr
(
0
,
newlinePos
);
Draw
(
aText
.
Mid
(
newlinePos
+
1
),
nextlinePosition
,
0.0
);
aText
=
aText
.
Mid
(
0
,
newlinePos
);
}
// Compute the text size
...
...
@@ -233,7 +234,7 @@ void STROKE_FONT::Draw( std::wstring aText, const VECTOR2D& aPosition, double aR
m_gal
->
SetLineWidth
(
m_gal
->
GetLineWidth
()
*
1.3
);
}
for
(
std
::
ws
tring
::
const_iterator
chIt
=
aText
.
begin
();
chIt
!=
aText
.
end
();
chIt
++
)
for
(
wxS
tring
::
const_iterator
chIt
=
aText
.
begin
();
chIt
!=
aText
.
end
();
chIt
++
)
{
if
(
*
chIt
==
'~'
)
{
...
...
@@ -292,11 +293,11 @@ void STROKE_FONT::Draw( std::wstring aText, const VECTOR2D& aPosition, double aR
}
VECTOR2D
STROKE_FONT
::
computeTextSize
(
const
std
::
ws
tring
&
aText
)
const
VECTOR2D
STROKE_FONT
::
computeTextSize
(
const
wxS
tring
&
aText
)
const
{
VECTOR2D
result
=
VECTOR2D
(
0.0
,
m_glyphSize
.
y
);
for
(
std
::
ws
tring
::
const_iterator
chIt
=
aText
.
begin
();
chIt
!=
aText
.
end
();
chIt
++
)
for
(
wxS
tring
::
const_iterator
chIt
=
aText
.
begin
();
chIt
!=
aText
.
end
();
chIt
++
)
{
if
(
*
chIt
==
'~'
)
continue
;
...
...
include/gal/graphics_abstraction_layer.h
View file @
ca11855f
...
...
@@ -277,7 +277,7 @@ public:
* @param aPosition is the text position in world coordinates.
* @param aRotationAngle is the text rotation angle.
*/
inline
virtual
void
StrokeText
(
const
std
::
ws
tring
&
aText
,
const
VECTOR2D
&
aPosition
,
inline
virtual
void
StrokeText
(
const
wxS
tring
&
aText
,
const
VECTOR2D
&
aPosition
,
double
aRotationAngle
)
{
strokeFont
.
Draw
(
aText
,
aPosition
,
aRotationAngle
);
...
...
include/gal/stroke_font.h
View file @
ca11855f
...
...
@@ -73,7 +73,7 @@ public:
* @param aPosition is the text position in world coordinates.
* @param aRotationAngle is the text rotation angle.
*/
void
Draw
(
std
::
ws
tring
aText
,
const
VECTOR2D
&
aPosition
,
double
aRotationAngle
);
void
Draw
(
wxS
tring
aText
,
const
VECTOR2D
&
aPosition
,
double
aRotationAngle
);
/**
* @brief Set the scale factor of the font for the glyph size.
...
...
@@ -180,7 +180,7 @@ private:
* @param aText is the text string.
* @return is the text size.
*/
VECTOR2D
computeTextSize
(
const
std
::
ws
tring
&
aText
)
const
;
VECTOR2D
computeTextSize
(
const
wxS
tring
&
aText
)
const
;
static
const
double
LINE_HEIGHT_RATIO
;
};
...
...
pcbnew/pcb_painter.cpp
View file @
ca11855f
...
...
@@ -719,7 +719,7 @@ void PCB_PAINTER::draw( const TEXTE_PCB* aText, int aLayer )
m_gal
->
SetStrokeColor
(
strokeColor
);
m_gal
->
SetLineWidth
(
aText
->
GetThickness
()
);
m_gal
->
SetTextAttributes
(
aText
);
m_gal
->
StrokeText
(
std
::
wstring
(
aText
->
GetText
().
wc_str
()
),
position
,
orientation
);
m_gal
->
StrokeText
(
aText
->
GetText
(
),
position
,
orientation
);
}
...
...
@@ -735,7 +735,7 @@ void PCB_PAINTER::draw( const TEXTE_MODULE* aText, int aLayer )
m_gal
->
SetStrokeColor
(
strokeColor
);
m_gal
->
SetLineWidth
(
aText
->
GetThickness
()
);
m_gal
->
SetTextAttributes
(
aText
);
m_gal
->
StrokeText
(
std
::
wstring
(
aText
->
GetText
().
wc_str
()
),
position
,
orientation
);
m_gal
->
StrokeText
(
aText
->
GetText
(
),
position
,
orientation
);
}
...
...
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