mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-28 07:03:00 +08:00
fix(property): support user added property index
Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
This commit is contained in:
parent
7c1a8a523d
commit
c191ecbfb6
@ -63,7 +63,7 @@ lv_result_t lv_obj_set_property(lv_obj_t * obj, const lv_property_t * value)
|
||||
LV_ASSERT(obj && value);
|
||||
|
||||
uint32_t index = LV_PROPERTY_ID_INDEX(value->id);
|
||||
if(value->id == LV_PROPERTY_ID_INVALID || index >= LV_PROPERTY_ID_BUILTIN_LAST) {
|
||||
if(value->id == LV_PROPERTY_ID_INVALID || index > LV_PROPERTY_ID_ANY) {
|
||||
LV_LOG_WARN("Invalid property id set to %p", obj);
|
||||
return LV_RESULT_INVALID;
|
||||
}
|
||||
@ -94,7 +94,7 @@ lv_property_t lv_obj_get_property(lv_obj_t * obj, lv_prop_id_t id)
|
||||
lv_property_t value = { 0 };
|
||||
|
||||
uint32_t index = LV_PROPERTY_ID_INDEX(id);
|
||||
if(id == LV_PROPERTY_ID_INVALID || index >= LV_PROPERTY_ID_BUILTIN_LAST) {
|
||||
if(id == LV_PROPERTY_ID_INVALID || index > LV_PROPERTY_ID_ANY) {
|
||||
LV_LOG_WARN("Invalid property id to get from %p", obj);
|
||||
value.id = LV_PROPERTY_ID_INVALID;
|
||||
value.num = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user