com.applitools.eyes.selenium.positioning.SafariRegionPositionCompensation Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of eyes-selenium-java3-jboss Show documentation
Show all versions of eyes-selenium-java3-jboss Show documentation
Applitools Eyes SDK for Selenium Java WebDriver
package com.applitools.eyes.selenium.positioning;
import com.applitools.eyes.Region;
public class SafariRegionPositionCompensation implements RegionPositionCompensation {
@Override
public Region compensateRegionPosition(Region region, double pixelRatio) {
if (pixelRatio == 1.0) {
return region;
}
if (region.getWidth() <= 0 || region.getHeight() <= 0) {
return Region.EMPTY;
}
return region.offset(0, (int) Math.ceil(pixelRatio));
}
}