improve widget_is_point_in

This commit is contained in:
lixianjing 2023-05-25 14:47:35 +08:00
parent 33855c4cac
commit 04f77c266e
2 changed files with 7 additions and 2 deletions

View File

@ -1,5 +1,8 @@
# 最新动态
2023/05/25
* 修改widget的xoffset 或 yoffset != 0时widget\_is\_point\_in结果不正确的问题(感谢朝泽提供补丁)
2023/05/24
* 完善编译脚本(感谢朝泽提供补丁)
* 导出assest\_manager\_build\_assest\_filename函数(感谢福明提供补丁)

View File

@ -4076,8 +4076,10 @@ bool_t widget_is_point_in(widget_t* widget, xy_t x, xy_t y, bool_t is_local) {
point_t p = {x, y};
return_value_if_fail(widget != NULL, FALSE);
if (!is_local) {
widget_to_local(widget, &p);
if (!is_local && widget->parent != NULL) {
widget_to_local(widget->parent, &p);
p.x -= widget->x;
p.y -= widget->y;
}
if (widget->vt->is_point_in != NULL) {