public class ContextBasedScaleProvider extends Object implements ScaleProvider
Constructor and Description |
---|
ContextBasedScaleProvider(Logger logger,
RectangleSize topLevelContextEntireSize,
RectangleSize viewportSize,
double devicePixelRatio,
boolean isMobileDevice) |
Modifier and Type | Method and Description |
---|---|
double |
getScaleRatio() |
void |
updateScaleRatio(int imageToScaleWidth)
Set the scale ratio based on the given image.
|
public ContextBasedScaleProvider(Logger logger, RectangleSize topLevelContextEntireSize, RectangleSize viewportSize, double devicePixelRatio, boolean isMobileDevice)
topLevelContextEntireSize
- The total size of the top level
context. E.g., for selenium this
would be the document size of the top
level frame.viewportSize
- The viewport size.devicePixelRatio
- The device pixel ratio of the
platform on which the application is
running.public double getScaleRatio()
getScaleRatio
in interface ScaleProvider
public void updateScaleRatio(int imageToScaleWidth)
imageToScaleWidth
- The width of the image to scale, used for calculating the scale ratio.Copyright © 2017. All rights reserved.