Socket
Socket
Sign inDemoInstall

fancy-canvas

Package Overview
Dependencies
Maintainers
2
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fancy-canvas - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

27

canvas-element-bitmap-size.js

@@ -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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc