Base maximum output dimensions on limitation of format

This commit is contained in:
Lovell Fuller
2017-05-04 23:20:37 +01:00
parent c8e59f08ec
commit 2f534dc01c
10 changed files with 82 additions and 47 deletions

View File

@@ -68,10 +68,7 @@ function overlayWith (overlay, options) {
}
}
if (is.defined(options.left) || is.defined(options.top)) {
if (
is.integer(options.left) && is.inRange(options.left, 0, this.constructor.maximum.width) &&
is.integer(options.top) && is.inRange(options.top, 0, this.constructor.maximum.height)
) {
if (is.integer(options.left) && options.left >= 0 && is.integer(options.top) && options.top >= 0) {
this.options.overlayXOffset = options.left;
this.options.overlayYOffset = options.top;
} else {