You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Short overview
When providing a search region to screen.find the resulting Region is off.
Issue occurs on
Virtual machine
Docker container
Dev/Host system
Detailed error description
When providing a search region to screen.find, the returned Region is relative to the provided search region.
It does not incorporate offsets provided by the search region, so the result does not properly translate onto desktop space.
Steps to reproduce error
Define a new Region containing your target image, e.g. const searchRegion = new Region(300, 200, 500, 500);
Search for the target image, providing a search region: const detectedRegion = await screen.find("target_image.png", {searchRegion})
Highlight the detected region: highlight(detectedRegion)
-> Highlighted region is off by x and y coordinates of our searchRegion
-> Correct region is highlighted Additional content
Please provide any (mandatory) additional data to reproduce the error (Dockerfiles etc.)
const{ screen, Region }=require("@nut-tree/nut-js");(async()=>{constsearchRegion=newRegion(300,400,500,500);constdetectedRegion=awaitscreen.find("image.png",{searchRegion})awaitscreen.highlight(detectedRegion);constcorrectedRegion=newRegion(searchRegion.left+detectedRegion.left,searchRegion.top+detectedRegion.top,detectedRegion.width,detectedRegion.height);awaitscreen.highlight(correctedRegion);})();
The text was updated successfully, but these errors were encountered:
Version
1.4.3-next.20200813090951
Short overview
When providing a search region to
screen.find
the resultingRegion
is off.Issue occurs on
Detailed error description
When providing a search region to
screen.find
, the returnedRegion
is relative to the provided search region.It does not incorporate offsets provided by the search region, so the result does not properly translate onto desktop space.
Steps to reproduce error
const searchRegion = new Region(300, 200, 500, 500);
const detectedRegion = await screen.find("target_image.png", {searchRegion})
highlight(detectedRegion)
Additional content
The text was updated successfully, but these errors were encountered: