fancy-canvas
Advanced tools
Comparing version 2.0.1 to 2.0.2
@@ -174,15 +174,8 @@ import { equalSizes, size } from './size.js'; | ||
var canvasRects = this._canvasElement.getClientRects(); | ||
if (canvasRects.length === 0) { | ||
return; | ||
} | ||
var newSize = size({ | ||
width: | ||
// "guessed" size | ||
Math.round(canvasRects[0].left * ratio + this._canvasElementClientSize.width * ratio) - | ||
Math.round(canvasRects[0].left * ratio), | ||
height: | ||
// "guessed" size | ||
Math.round(canvasRects[0].top * ratio + this._canvasElementClientSize.height * ratio) - | ||
Math.round(canvasRects[0].top * ratio), | ||
}); | ||
var newSize = canvasRects.length > 0 ? | ||
predictedBitmapSize(canvasRects[0], ratio) : | ||
size({ | ||
width: this._canvasElementClientSize.width * ratio, | ||
height: this._canvasElementClientSize.height * ratio, | ||
}); | ||
this._suggestNewBitmapSize(newSize); | ||
@@ -237,1 +230,9 @@ }; | ||
} | ||
function predictedBitmapSize(canvasRect, ratio) { | ||
return size({ | ||
width: Math.round(canvasRect.left * ratio + canvasRect.width * ratio) - | ||
Math.round(canvasRect.left * ratio), | ||
height: Math.round(canvasRect.top * ratio + canvasRect.height * ratio) - | ||
Math.round(canvasRect.top * ratio), | ||
}); | ||
} |
{ | ||
"name": "fancy-canvas", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"author": "smakarov@tradingview.com", | ||
@@ -5,0 +5,0 @@ "description": "Functionality on top of HTML canvas element, including support for HiDPI and pixel-perfect rendering", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17833
383