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
f0a70559
Commit
f0a70559
authored
Feb 24, 2018
by
Gabor Kiss-Vamosi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor shadow bottom draw bugfix
parent
07654075
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
26 deletions
+33
-26
lv_draw.c
lv_draw/lv_draw.c
+28
-21
lv_theme_material.c
lv_themes/lv_theme_material.c
+5
-5
No files found.
lv_draw/lv_draw.c
View file @
f0a70559
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
#define LABEL_RECOLOR_PAR_LENGTH 6
#define LABEL_RECOLOR_PAR_LENGTH 6
#define SHADOW_OPA_EXTRA_PRECISION 8
/*Calculate with 2^x bigger shadow opacity values to avoid rounding errors*/
#define SHADOW_OPA_EXTRA_PRECISION 8
/*Calculate with 2^x bigger shadow opacity values to avoid rounding errors*/
#define SHADOW_BOTTOM_AA_EXTRA_RADIUS
4
/*Add extra radius with LV_SHADOW_BOTTOM to cover anti-aliased corners*/
#define SHADOW_BOTTOM_AA_EXTRA_RADIUS
3
/*Add extra radius with LV_SHADOW_BOTTOM to cover anti-aliased corners*/
/**********************
/**********************
* TYPEDEFS
* TYPEDEFS
**********************/
**********************/
...
@@ -1840,7 +1840,7 @@ static void lv_draw_shadow_bottom(const lv_area_t * coords, const lv_area_t * ma
...
@@ -1840,7 +1840,7 @@ static void lv_draw_shadow_bottom(const lv_area_t * coords, const lv_area_t * ma
radius
=
lv_draw_cont_radius_corr
(
radius
,
width
,
height
);
radius
=
lv_draw_cont_radius_corr
(
radius
,
width
,
height
);
radius
+=
LV_ANTIALIAS
*
SHADOW_BOTTOM_AA_EXTRA_RADIUS
;
radius
+=
LV_ANTIALIAS
*
SHADOW_BOTTOM_AA_EXTRA_RADIUS
;
swidth
+=
LV_ANTIALIAS
;
swidth
+=
LV_ANTIALIAS
;
lv_coord_t
curve_x
[
radius
+
1
];
/*Stores the 'x' coordinates of a quarter circle.*/
lv_coord_t
curve_x
[
radius
+
1
];
/*Stores the 'x' coordinates of a quarter circle.*/
lv_point_t
circ
;
lv_point_t
circ
;
...
@@ -1852,46 +1852,53 @@ static void lv_draw_shadow_bottom(const lv_area_t * coords, const lv_area_t * ma
...
@@ -1852,46 +1852,53 @@ static void lv_draw_shadow_bottom(const lv_area_t * coords, const lv_area_t * ma
lv_circ_next
(
&
circ
,
&
circ_tmp
);
lv_circ_next
(
&
circ
,
&
circ_tmp
);
}
}
int16_t
row
;
int16_t
col
;
lv_opa_t
line_1d_blur
[
swidth
];
lv_opa_t
line_1d_blur
[
swidth
];
for
(
row
=
0
;
row
<
swidth
;
row
++
)
{
for
(
col
=
0
;
col
<
swidth
;
col
++
)
{
line_1d_blur
[
row
]
=
(
uint32_t
)((
uint32_t
)(
swidth
-
row
)
*
style
->
body
.
opa
)
/
(
swidth
);
line_1d_blur
[
col
]
=
(
uint32_t
)((
uint32_t
)(
swidth
-
col
)
*
style
->
body
.
opa
)
/
(
swidth
);
}
}
lv_point_t
point_l
;
lv_point_t
point_l
;
lv_point_t
point_r
;
lv_point_t
point_r
;
lv_area_t
area_mid
;
lv_area_t
area_mid
;
lv_point_t
ofs1
;
lv_point_t
ofs_l
;
lv_point_t
ofs2
;
lv_point_t
ofs_r
;
ofs_l
.
x
=
coords
->
x1
+
radius
;
ofs_l
.
y
=
coords
->
y2
-
radius
+
1
-
LV_ANTIALIAS
;
ofs
1
.
x
=
coords
->
x1
+
radius
;
ofs
_r
.
x
=
coords
->
x2
-
radius
;
ofs
1
.
y
=
coords
->
y2
-
radius
+
1
-
LV_ANTIALIAS
;
ofs
_r
.
y
=
coords
->
y2
-
radius
+
1
-
LV_ANTIALIAS
;
ofs2
.
x
=
coords
->
x2
-
radius
;
printf
(
"
\n\n
"
);
ofs2
.
y
=
coords
->
y2
-
radius
+
1
-
LV_ANTIALIAS
;
for
(
row
=
0
;
row
<=
radius
;
row
++
)
{
for
(
col
=
0
;
col
<=
radius
;
col
++
)
{
point_l
.
x
=
ofs
1
.
x
+
radius
-
row
-
radius
;
point_l
.
x
=
ofs
_l
.
x
+
radius
-
col
-
radius
;
point_l
.
y
=
ofs
1
.
y
+
curve_x
[
row
];
point_l
.
y
=
ofs
_l
.
y
+
curve_x
[
col
];
point_r
.
x
=
ofs2
.
x
+
row
;
point_r
.
x
=
ofs_r
.
x
+
col
;
point_r
.
y
=
ofs2
.
y
+
curve_x
[
row
];
point_r
.
y
=
ofs_r
.
y
+
curve_x
[
col
];
printf
(
"lx:%d, rx:%d
\n
"
,
point_l
.
x
,
point_r
.
x
);
uint16_t
d
;
uint16_t
d
;
for
(
d
=
0
;
d
<
swidth
;
d
++
)
{
for
(
d
=
0
;
d
<
swidth
;
d
++
)
{
px_fp
(
point_l
.
x
,
point_l
.
y
,
mask
,
style
->
body
.
shadow
.
color
,
line_1d_blur
[
d
]);
px_fp
(
point_l
.
x
,
point_l
.
y
,
mask
,
style
->
body
.
shadow
.
color
,
line_1d_blur
[
d
]);
point_l
.
y
++
;
point_l
.
y
++
;
px_fp
(
point_r
.
x
,
point_r
.
y
,
mask
,
style
->
body
.
shadow
.
color
,
line_1d_blur
[
d
]);
/*Don't overdraw th pixel on the middle*/
point_r
.
y
++
;
if
(
point_r
.
x
>
ofs_l
.
x
)
{
px_fp
(
point_r
.
x
,
point_r
.
y
,
mask
,
style
->
body
.
shadow
.
color
,
line_1d_blur
[
d
]);
point_r
.
y
++
;
}
}
}
}
}
area_mid
.
x1
=
ofs
1
.
x
+
1
;
area_mid
.
x1
=
ofs
_l
.
x
+
1
;
area_mid
.
y1
=
ofs
1
.
y
+
radius
;
area_mid
.
y1
=
ofs
_l
.
y
+
radius
;
area_mid
.
x2
=
ofs
2
.
x
-
1
;
area_mid
.
x2
=
ofs
_r
.
x
-
1
;
area_mid
.
y2
=
area_mid
.
y1
;
area_mid
.
y2
=
area_mid
.
y1
;
uint16_t
d
;
uint16_t
d
;
...
...
lv_themes/lv_theme_material.c
View file @
f0a70559
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
* DEFINES
* DEFINES
*********************/
*********************/
#define DEF_RADIUS 4
#define DEF_RADIUS 4
#define DEF_SHADOW_COLOR LV_COLOR_HEX3(0x
888
)
#define DEF_SHADOW_COLOR LV_COLOR_HEX3(0x
aaa
)
/**********************
/**********************
* TYPEDEFS
* TYPEDEFS
...
@@ -259,7 +259,7 @@ static void sw_init(void)
...
@@ -259,7 +259,7 @@ static void sw_init(void)
sw_indic
.
body
.
radius
=
LV_RADIUS_CIRCLE
;
sw_indic
.
body
.
radius
=
LV_RADIUS_CIRCLE
;
lv_style_copy
(
&
sw_knob_on
,
theme
.
slider
.
knob
);
lv_style_copy
(
&
sw_knob_on
,
theme
.
slider
.
knob
);
sw_knob_on
.
body
.
shadow
.
width
=
4
;
sw_knob_on
.
body
.
shadow
.
width
=
3
;
sw_knob_on
.
body
.
shadow
.
type
=
LV_SHADOW_BOTTOM
;
sw_knob_on
.
body
.
shadow
.
type
=
LV_SHADOW_BOTTOM
;
sw_knob_on
.
body
.
shadow
.
color
=
DEF_SHADOW_COLOR
;
sw_knob_on
.
body
.
shadow
.
color
=
DEF_SHADOW_COLOR
;
...
@@ -328,7 +328,7 @@ static void cb_init(void)
...
@@ -328,7 +328,7 @@ static void cb_init(void)
static
lv_style_t
rel
,
pr
,
tgl_rel
,
tgl_pr
,
ina
;
static
lv_style_t
rel
,
pr
,
tgl_rel
,
tgl_pr
,
ina
;
lv_style_copy
(
&
rel
,
theme
.
panel
);
lv_style_copy
(
&
rel
,
theme
.
panel
);
rel
.
body
.
shadow
.
type
=
LV_SHADOW_BOTTOM
;
rel
.
body
.
shadow
.
type
=
LV_SHADOW_BOTTOM
;
rel
.
body
.
shadow
.
width
=
2
;
rel
.
body
.
shadow
.
width
=
3
;
lv_style_copy
(
&
pr
,
&
rel
);
lv_style_copy
(
&
pr
,
&
rel
);
pr
.
body
.
main_color
=
LV_COLOR_HEX3
(
0xccc
);
pr
.
body
.
main_color
=
LV_COLOR_HEX3
(
0xccc
);
...
@@ -370,7 +370,7 @@ static void btnm_init(void)
...
@@ -370,7 +370,7 @@ static void btnm_init(void)
bg
.
text
.
color
=
LV_COLOR_HEX3
(
0x555
);
bg
.
text
.
color
=
LV_COLOR_HEX3
(
0x555
);
lv_style_copy
(
&
rel
,
theme
.
panel
);
lv_style_copy
(
&
rel
,
theme
.
panel
);
rel
.
body
.
border
.
part
=
LV_BORDER_RIGHT
|
LV_BORDER_BOTTOM
;
rel
.
body
.
border
.
part
=
LV_BORDER_RIGHT
;
rel
.
body
.
border
.
width
=
1
;
rel
.
body
.
border
.
width
=
1
;
rel
.
body
.
border
.
color
=
LV_COLOR_HEX3
(
0xbbb
);
rel
.
body
.
border
.
color
=
LV_COLOR_HEX3
(
0xbbb
);
rel
.
body
.
empty
=
1
;
rel
.
body
.
empty
=
1
;
...
@@ -597,7 +597,7 @@ static void tabview_init(void)
...
@@ -597,7 +597,7 @@ static void tabview_init(void)
btn_bg
.
body
.
border
.
color
=
LV_COLOR_HEX3
(
0x888
);
btn_bg
.
body
.
border
.
color
=
LV_COLOR_HEX3
(
0x888
);
btn_bg
.
body
.
border
.
part
=
LV_BORDER_BOTTOM
;
btn_bg
.
body
.
border
.
part
=
LV_BORDER_BOTTOM
;
btn_bg
.
body
.
border
.
opa
=
LV_OPA_COVER
;
btn_bg
.
body
.
border
.
opa
=
LV_OPA_COVER
;
btn_bg
.
body
.
shadow
.
width
=
6
;
btn_bg
.
body
.
shadow
.
width
=
5
;
btn_bg
.
body
.
shadow
.
color
=
DEF_SHADOW_COLOR
;
btn_bg
.
body
.
shadow
.
color
=
DEF_SHADOW_COLOR
;
btn_bg
.
body
.
shadow
.
type
=
LV_SHADOW_BOTTOM
;
btn_bg
.
body
.
shadow
.
type
=
LV_SHADOW_BOTTOM
;
btn_bg
.
body
.
padding
.
inner
=
0
;
btn_bg
.
body
.
padding
.
inner
=
0
;
...
...
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