On Mon, 21 Oct 2024 13:35:12 GMT, Alexey Ivanov <aiva...@openjdk.org> wrote:

>> Naveen Narayanan has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   8342098: Updated review comments
>
> test/jdk/java/awt/Robot/ScreenCaptureRobotTest.java line 94:
> 
>> 92: 
>> 93:         Point pnt = canvas.getLocationOnScreen();
>> 94:         Rectangle rect = new Rectangle(pnt.x + 10, pnt.y + 10, 200, 100);
> 
> Why are coordinates of the start of the canvas are offset by 10 pixels but 
> the size isn't? The image is 200×100, then you capture 10 pixels on the right 
> and bottom which belong to whatever is on the screen in this area.

@aivanov-jdk 
While creating the Canvas 
drawImage(realImage, 10, 10, this)
10 offset is used.

Hence the start point coordinates also moved by 10 pixels
for capturing.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/21524#discussion_r1822763345

Reply via email to