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
bbbf8225
Commit
bbbf8225
authored
Feb 05, 2018
by
Gabor Kiss-Vamosi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lv_slider: fix knob_in with not zero min value
parent
0bf1d147
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
lv_slider.c
lv_objx/lv_slider.c
+3
-2
No files found.
lv_objx/lv_slider.c
View file @
bbbf8225
...
@@ -126,6 +126,7 @@ void lv_slider_set_knob_in(lv_obj_t * slider, bool in)
...
@@ -126,6 +126,7 @@ void lv_slider_set_knob_in(lv_obj_t * slider, bool in)
{
{
lv_slider_ext_t
*
ext
=
lv_obj_get_ext_attr
(
slider
);
lv_slider_ext_t
*
ext
=
lv_obj_get_ext_attr
(
slider
);
ext
->
knob_in
=
in
==
false
?
0
:
1
;
ext
->
knob_in
=
in
==
false
?
0
:
1
;
lv_obj_invalidate
(
slider
);
}
}
/**
/**
...
@@ -324,7 +325,7 @@ static bool lv_slider_design(lv_obj_t * slider, const lv_area_t * mask, lv_desig
...
@@ -324,7 +325,7 @@ static bool lv_slider_design(lv_obj_t * slider, const lv_area_t * mask, lv_desig
knob_area
.
x1
=
area_indic
.
x2
-
slider_h
/
2
;
knob_area
.
x1
=
area_indic
.
x2
-
slider_h
/
2
;
knob_area
.
x2
=
knob_area
.
x1
+
slider_h
;
knob_area
.
x2
=
knob_area
.
x1
+
slider_h
;
}
else
{
}
else
{
knob_area
.
x1
=
(
int32_t
)
((
int32_t
)(
slider_w
-
slider_h
)
*
cur_value
)
/
(
max_value
-
min_value
);
knob_area
.
x1
=
(
int32_t
)
((
int32_t
)(
slider_w
-
slider_h
)
*
(
cur_value
-
min_value
)
)
/
(
max_value
-
min_value
);
knob_area
.
x1
+=
slider
->
coords
.
x1
;
knob_area
.
x1
+=
slider
->
coords
.
x1
;
knob_area
.
x2
=
knob_area
.
x1
+
slider_h
;
knob_area
.
x2
=
knob_area
.
x1
+
slider_h
;
}
}
...
@@ -336,7 +337,7 @@ static bool lv_slider_design(lv_obj_t * slider, const lv_area_t * mask, lv_desig
...
@@ -336,7 +337,7 @@ static bool lv_slider_design(lv_obj_t * slider, const lv_area_t * mask, lv_desig
knob_area
.
y1
=
area_indic
.
y1
-
slider_w
/
2
;
knob_area
.
y1
=
area_indic
.
y1
-
slider_w
/
2
;
knob_area
.
y2
=
knob_area
.
y1
+
slider_w
;
knob_area
.
y2
=
knob_area
.
y1
+
slider_w
;
}
else
{
}
else
{
knob_area
.
y2
=
(
int32_t
)
((
int32_t
)(
slider_h
-
slider_w
)
*
cur_value
)
/
(
max_value
-
min_value
);
knob_area
.
y2
=
(
int32_t
)
((
int32_t
)(
slider_h
-
slider_w
)
*
(
cur_value
-
min_value
)
)
/
(
max_value
-
min_value
);
knob_area
.
y2
=
slider
->
coords
.
y2
-
knob_area
.
y2
;
knob_area
.
y2
=
slider
->
coords
.
y2
-
knob_area
.
y2
;
knob_area
.
y1
=
knob_area
.
y2
-
slider_w
;
knob_area
.
y1
=
knob_area
.
y2
-
slider_w
;
}
}
...
...
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