From c191ecbfb60d628252d3cb012a5a216f2b7f23d3 Mon Sep 17 00:00:00 2001 From: Neo Xu Date: Sat, 3 Aug 2024 16:10:57 +0800 Subject: [PATCH] fix(property): support user added property index Signed-off-by: Neo Xu --- src/core/lv_obj_property.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/lv_obj_property.c b/src/core/lv_obj_property.c index 3d1cf4c3c..020794890 100644 --- a/src/core/lv_obj_property.c +++ b/src/core/lv_obj_property.c @@ -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;