Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
TFT_eSPI
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
TFT_eSPI
Commits
a474f4cd
Commit
a474f4cd
authored
Dec 12, 2021
by
Bodmer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #1313
parent
bcce0fc7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
Extensions/Sprite.cpp
Extensions/Sprite.cpp
+10
-5
No files found.
Extensions/Sprite.cpp
View file @
a474f4cd
...
@@ -2529,19 +2529,24 @@ void TFT_eSprite::printToSprite(char *cbuffer, uint16_t len) //String string)
...
@@ -2529,19 +2529,24 @@ void TFT_eSprite::printToSprite(char *cbuffer, uint16_t len) //String string)
uint16_t
n
=
0
;
uint16_t
n
=
0
;
bool
newSprite
=
!
_created
;
bool
newSprite
=
!
_created
;
int16_t
cursorX
=
_tft
->
cursor_x
;
if
(
newSprite
)
if
(
newSprite
)
{
{
int16_t
sWidth
=
1
;
int16_t
sWidth
=
0
;
uint16_t
index
=
0
;
uint16_t
index
=
0
;
bool
first
=
true
;
while
(
n
<
len
)
while
(
n
<
len
)
{
{
uint16_t
unicode
=
decodeUTF8
((
uint8_t
*
)
cbuffer
,
&
n
,
len
-
n
);
uint16_t
unicode
=
decodeUTF8
((
uint8_t
*
)
cbuffer
,
&
n
,
len
-
n
);
if
(
getUnicodeIndex
(
unicode
,
&
index
))
if
(
getUnicodeIndex
(
unicode
,
&
index
))
{
{
if
(
n
==
0
)
sWidth
-=
gdX
[
index
];
if
(
first
)
{
if
(
n
==
len
-
1
)
sWidth
+=
(
gWidth
[
index
]
+
gdX
[
index
]);
first
=
false
;
sWidth
-=
gdX
[
index
];
cursorX
+=
gdX
[
index
];
}
if
(
n
==
len
)
sWidth
+=
(
gWidth
[
index
]
+
gdX
[
index
]);
else
sWidth
+=
gxAdvance
[
index
];
else
sWidth
+=
gxAdvance
[
index
];
}
}
else
sWidth
+=
gFont
.
spaceWidth
+
1
;
else
sWidth
+=
gFont
.
spaceWidth
+
1
;
...
@@ -2564,7 +2569,7 @@ void TFT_eSprite::printToSprite(char *cbuffer, uint16_t len) //String string)
...
@@ -2564,7 +2569,7 @@ void TFT_eSprite::printToSprite(char *cbuffer, uint16_t len) //String string)
if
(
newSprite
)
if
(
newSprite
)
{
// The sprite had to be created so place at TFT cursor
{
// The sprite had to be created so place at TFT cursor
pushSprite
(
_tft
->
cursor_x
,
_tft
->
cursor_y
);
pushSprite
(
cursorX
,
_tft
->
cursor_y
);
deleteSprite
();
deleteSprite
();
}
}
}
}
...
...
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