How to update the coords when the image is scaled?

After many tests, I found that when the picture is zoomed, the coords of the object is not updated, that is, the area where the object is touched has not changed. In this case, for a zoom-in image, clicking on the edge position of the object cannot produce a response, because the coords of the object is still original. So I wonder if there is a better way to achieve this?

The current implementation of rotation and scaling is purely visual, and do not affect the processing of pointer input, for performance and simplicity reasons.

The reason why input is not processed on the full surface of a zoomed image is because it uses a special feature whereby an object’s edges can be extended outwards without needing to change its size/position. The input system ignores this extra area, however.

Perhaps you could try creating a larger container, putting the image inside that, and using the container to catch input events? Or (untested) try lv_img_set_auto_size(img, false) and then manually resize the image object to be larger. That way the input system will still consider the image area as part of the image object’s normal coordinates.

Thank you for reply.
I can try to modify the coords of the object to see the effect(Pointer input).

Hi.
I have modified this code, and run the test to find that it works.

@src/lv_core/lv_indev.c
lv_indev_search_obj(…)

I recommend continuing to use this patch locally for v6.1; I have added a similar feature to dev-7.0 using the new customizable hit-testing system.

1 Like

Very good.

Best regards.