BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lvgl
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
lvgl
Commits
1689a121
Commit
1689a121
authored
Jan 30, 2018
by
Gabor Kiss-Vamosi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
label draw bugfix: upscale offset with anti-aliasing
parent
a2db424e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
lv_draw.c
lv_draw/lv_draw.c
+7
-3
No files found.
lv_draw/lv_draw.c
View file @
1689a121
...
@@ -310,14 +310,18 @@ void lv_draw_label(const lv_area_t * coords,const lv_area_t * mask, const lv_sty
...
@@ -310,14 +310,18 @@ void lv_draw_label(const lv_area_t * coords,const lv_area_t * mask, const lv_sty
lv_color_t
recolor
;
lv_color_t
recolor
;
lv_coord_t
letter_w
;
lv_coord_t
letter_w
;
lv_coord_t
x_ofs
=
0
;
lv_coord_t
y_ofs
=
0
;
if
(
offset
!=
NULL
)
{
if
(
offset
!=
NULL
)
{
pos
.
y
+=
offset
->
y
;
x_ofs
=
offset
->
x
<<
LV_ANTIALIAS
<<
LV_FONT_ANTIALIAS
;
y_ofs
=
offset
->
y
<<
LV_ANTIALIAS
<<
LV_FONT_ANTIALIAS
;
pos
.
y
+=
y_ofs
;
}
}
/*Write out all lines*/
/*Write out all lines*/
while
(
txt
[
line_start
]
!=
'\0'
)
{
while
(
txt
[
line_start
]
!=
'\0'
)
{
if
(
offset
!=
NULL
)
{
if
(
offset
!=
NULL
)
{
pos
.
x
+=
offset
->
x
;
pos
.
x
+=
x_ofs
;
}
}
/*Write all letter of a line*/
/*Write all letter of a line*/
cmd_state
=
CMD_STATE_WAIT
;
cmd_state
=
CMD_STATE_WAIT
;
...
@@ -369,7 +373,7 @@ void lv_draw_label(const lv_area_t * coords,const lv_area_t * mask, const lv_sty
...
@@ -369,7 +373,7 @@ void lv_draw_label(const lv_area_t * coords,const lv_area_t * mask, const lv_sty
pos
.
x
+=
letter_w
+
(
style
->
text
.
letter_space
<<
LV_AA
);
pos
.
x
+=
letter_w
+
(
style
->
text
.
letter_space
<<
LV_AA
);
/* Round error occurs in x position
/* Round error occurs in x position
* When odd widths are scaled down the last 1 is lost. So the letters seems shorter.
* When odd widths are scaled down the last 1 is lost. So the letters seems shorter.
* Now calculate according to i
s
to be consequent */
* Now calculate according to i
t
to be consequent */
if
(
letter_w
&
0x01
)
pos
.
x
--
;
if
(
letter_w
&
0x01
)
pos
.
x
--
;
}
}
/*Go to next line*/
/*Go to next line*/
...
...
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