diff --git a/src/hasp/hasp_attribute.cpp b/src/hasp/hasp_attribute.cpp index 202cf80a..b40e42f0 100644 --- a/src/hasp/hasp_attribute.cpp +++ b/src/hasp/hasp_attribute.cpp @@ -1353,6 +1353,8 @@ static hasp_attribute_type_t specific_coord_attribute(lv_obj_t* obj, uint16_t at hasp_attr_update_lv_coord_t list[] = { {LV_HASP_IMAGE, ATTR_OFFSET_X, lv_img_set_offset_x, lv_img_get_offset_x}, {LV_HASP_IMAGE, ATTR_OFFSET_Y, lv_img_set_offset_y, lv_img_get_offset_y}, + {LV_HASP_IMAGE, ATTR_PIVOT_X, my_img_set_pivot_x, my_img_get_pivot_x}, + {LV_HASP_IMAGE, ATTR_PIVOT_Y, my_img_set_pivot_y, my_img_get_pivot_y}, {LV_HASP_DROPDOWN, ATTR_MAX_HEIGHT, lv_dropdown_set_max_height, my_dropdown_get_max_height}}; if(do_attribute(list, obj, attr_hash, val, update)) return HASP_ATTR_TYPE_INT; } diff --git a/src/hasp/hasp_attribute_helper.h b/src/hasp/hasp_attribute_helper.h index cfca85d9..d9f64d36 100644 --- a/src/hasp/hasp_attribute_helper.h +++ b/src/hasp/hasp_attribute_helper.h @@ -11,6 +11,34 @@ const char* my_tabview_get_tab_name(const lv_obj_t* tabview, uint16_t id) return ext->tab_name_ptr[id]; } +static void my_img_set_pivot_x(lv_obj_t* obj, lv_coord_t x) +{ + lv_point_t point; + lv_img_get_pivot(obj, &point); + lv_img_set_pivot(obj, x, point.y); +} + +static void my_img_set_pivot_y(lv_obj_t* obj, lv_coord_t y) +{ + lv_point_t point; + lv_img_get_pivot(obj, &point); + lv_img_set_pivot(obj, point.x, y); +} + +static lv_coord_t my_img_get_pivot_x(lv_obj_t* obj) +{ + lv_point_t point; + lv_img_get_pivot(obj, &point); + return point.x; +} + +static lv_coord_t my_img_get_pivot_y(lv_obj_t* obj) +{ + lv_point_t point; + lv_img_get_pivot(obj, &point); + return point.y; +} + // OK - this function is missing in lvgl static uint8_t my_roller_get_visible_row_count(const lv_obj_t* roller) {