File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -101,17 +101,17 @@ export class Screen {
101101
102102 return new Promise < Region > ( async ( resolve , reject ) => {
103103 try {
104- if ( region . left < 0 || region . top < 0 || region . width < 0 || region . height < 0 ) {
105- throw new Error ( `Negative values in search region ${ region } ` )
104+ if ( searchRegion . left < 0 || searchRegion . top < 0 || searchRegion . width < 0 || searchRegion . height < 0 ) {
105+ throw new Error ( `Negative values in search region ${ searchRegion } ` )
106106 }
107- if ( isNaN ( region . left ) || isNaN ( region . top ) || isNaN ( region . width ) || isNaN ( region . height ) ) {
108- throw new Error ( `NaN values in search region ${ region } ` )
107+ if ( isNaN ( searchRegion . left ) || isNaN ( searchRegion . top ) || isNaN ( searchRegion . width ) || isNaN ( searchRegion . height ) ) {
108+ throw new Error ( `NaN values in search region ${ searchRegion } ` )
109109 }
110- if ( region . width < 2 || region . height < 2 ) {
111- throw new Error ( `Search region ${ region } is not large enough. Must be at least two pixels in both width and height.` )
110+ if ( searchRegion . width < 2 || searchRegion . height < 2 ) {
111+ throw new Error ( `Search region ${ searchRegion } is not large enough. Must be at least two pixels in both width and height.` )
112112 }
113- if ( region . left + region . width > screenSize . width || region . top + region . height > screenSize . height ) {
114- throw new Error ( `Search region ${ region } extends beyond screen boundaries (${ screenSize . width } x${ screenSize . height } )` )
113+ if ( searchRegion . left + searchRegion . width > screenSize . width || searchRegion . top + searchRegion . height > screenSize . height ) {
114+ throw new Error ( `Search region ${ searchRegion } extends beyond screen boundaries (${ screenSize . width } x${ screenSize . height } )` )
115115 }
116116 const matchResult = await this . vision . findOnScreenRegion ( matchRequest ) ;
117117 if ( matchResult . confidence >= minMatch ) {
You can’t perform that action at this time.
0 commit comments