All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.applitools.eyes.selenium.positioning.SafariRegionPositionCompensation Maven / Gradle / Ivy

The newest version!
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));
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy