File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
src/main/java/com/assertthat/selenium_shutterbug/utils/web Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -198,19 +198,24 @@ public int getCurrentScrollY() {
198198 }
199199
200200 public int getDocWidth () {
201- return docWidth != -1 ? docWidth : (int )(((Long ) executeJsScript (MAX_DOC_WIDTH_JS ))*devicePixelRatio );
201+ if (docWidth == -1 ) docWidth = (int ) (((Long ) executeJsScript (MAX_DOC_WIDTH_JS )) * devicePixelRatio );
202+ return docWidth ;
202203 }
203204
204205 public int getDocHeight () {
205- return docHeight != -1 ? docHeight : (int )(((Long ) executeJsScript (MAX_DOC_HEIGHT_JS ))*devicePixelRatio );
206+ if (docHeight == -1 ) docHeight = (int ) (((Long ) executeJsScript (MAX_DOC_HEIGHT_JS )) * devicePixelRatio );
207+ return docHeight ;
206208 }
207209
208210 public int getViewportWidth () {
209- return viewportWidth != -1 ? viewportWidth : (int )(((Long ) executeJsScript (VIEWPORT_WIDTH_JS ))*devicePixelRatio );
211+ if (viewportWidth == -1 ) viewportWidth = (int ) (((Long ) executeJsScript (VIEWPORT_WIDTH_JS )) * devicePixelRatio );
212+ return viewportWidth ;
210213 }
211214
212215 public int getViewportHeight () {
213- return viewportHeight != -1 ? viewportHeight : (int )(((Long ) executeJsScript (VIEWPORT_HEIGHT_JS )).intValue ()*devicePixelRatio );
216+ if (viewportHeight == -1 )
217+ viewportHeight = (int ) (((Long ) executeJsScript (VIEWPORT_HEIGHT_JS )) * devicePixelRatio );
218+ return viewportHeight ;
214219 }
215220
216221 public Coordinates getBoundingClientRect (WebElement element ) {
You can’t perform that action at this time.
0 commit comments