File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
src/main/java/com/assertthat/selenium_shutterbug/utils/web Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -40,14 +40,15 @@ public class Browser {
4040 private int docWidth = -1 ;
4141 private int viewportWidth = -1 ;
4242 private int viewportHeight = -1 ;
43- private int currentScrollX ;
44- private int currentScrollY ;
4543 private int scrollTimeout ;
46- private Long devicePixelRatio ;
44+ private Double devicePixelRatio = 1.0 ;
4745
4846 public Browser (WebDriver driver , boolean useDevicePixelRatio ) {
4947 this .driver = driver ;
50- devicePixelRatio = useDevicePixelRatio ?((Long )executeJsScript (DEVICE_PIXEL_RATIO )):1 ;
48+ if (useDevicePixelRatio ) {
49+ Object devicePixelRatio = executeJsScript (DEVICE_PIXEL_RATIO );
50+ this .devicePixelRatio = devicePixelRatio instanceof Double ? (Double )devicePixelRatio : (Long )devicePixelRatio *1.0 ;
51+ }
5152 }
5253
5354 public static void wait (int milis ) {
You can’t perform that action at this time.
0 commit comments