leexgone / uiautomation-rs

The uiatomation-rs crate is a wrapper for windows uiautomation. This crate can help you make windows uiautomation API calls conveniently.
Apache License 2.0
88 stars 15 forks source link

Element click is not clicking at center of the element #21

Closed myasin-codoid closed 2 years ago

myasin-codoid commented 2 years ago

Element click is not clicking at center of the element.

Issue: Element is getting clicked exactly at edge of the bounding rectangle. Due to this, click event is not triggered.

Expected: Element should be clicked at the center of the bounding rectangle.

leexgone commented 2 years ago

The element try to get the click point by UIElement.get_clickable_point() firstly. When got failed, the element will try to calc the point by UIElement.get_bounding_rectangle.

You can print the results of UIElement.get_clickable_point() and UIElement.get_bounding_rectangle to debug before click. FYI.