Socket
Socket
Sign inDemoInstall

fancy-canvas

Package Overview
Dependencies
Maintainers
3
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 0.2.1 to 0.2.2

5

coordinate-space.d.ts

@@ -18,2 +18,5 @@ export declare type Size = {

}
export declare function bindToDevicePixelRatio(canvas: HTMLCanvasElement): Binding;
export interface BindingOptions {
allowDownsampling: boolean;
}
export declare function bindToDevicePixelRatio(canvas: HTMLCanvasElement, options?: BindingOptions): Binding;

13

coordinate-space.js

@@ -1,6 +0,10 @@

export function bindToDevicePixelRatio(canvas) {
return new DevicePixelRatioBinding(canvas);
var defaultBindingOptions = {
allowDownsampling: true,
};
export function bindToDevicePixelRatio(canvas, options) {
if (options === void 0) { options = defaultBindingOptions; }
return new DevicePixelRatioBinding(canvas, options);
}
var DevicePixelRatioBinding = /** @class */ (function () {
function DevicePixelRatioBinding(canvas) {
function DevicePixelRatioBinding(canvas, options) {
var _this = this;

@@ -15,2 +19,3 @@ this._resolutionMediaQueryList = null;

};
this._options = options;
this._configureCanvas();

@@ -49,3 +54,3 @@ this._installResolutionListener();

}
return win.devicePixelRatio;
return win.devicePixelRatio > 1 || this._options.allowDownsampling ? win.devicePixelRatio : 1;
},

@@ -52,0 +57,0 @@ enumerable: true,

{
"name": "fancy-canvas",
"version": "0.2.1",
"version": "0.2.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