🚀 Big News:Socket Has Acquired Secure Annex.Learn More
Socket
Book a DemoSign in
Socket

konva

Package Overview
Dependencies
Maintainers
1
Versions
240
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

konva - npm Package Compare versions

Comparing version
10.0.11
to
10.0.12
+1
-1
lib/Global.js

@@ -16,3 +16,3 @@ const PI_OVER_180 = Math.PI / 180;

_global: glob,
version: '10.0.11',
version: '10.0.12',
isBrowser: detectBrowser(),

@@ -19,0 +19,0 @@ isUnminified: /param/.test(function (param) { }.toString()),

@@ -440,13 +440,22 @@ import { Konva } from "./Global.js";

const c = this.createCanvasElement();
c.width = 1;
c.height = 1;
c.width = 10;
c.height = 10;
const ctx = c.getContext('2d', {
willReadFrequently: true,
});
ctx.clearRect(0, 0, 1, 1);
ctx.fillStyle = 'rgba(255,0,255,1)';
ctx.fillRect(0, 0, 1, 1);
const d = ctx.getImageData(0, 0, 1, 1).data;
const exact = d[0] === 255 && d[1] === 0 && d[2] === 255 && d[3] === 255;
_isCanvasFarblingActive = !exact;
ctx.clearRect(0, 0, 10, 10);
ctx.fillStyle = '#282828';
ctx.fillRect(0, 0, 10, 10);
const d = ctx.getImageData(0, 0, 10, 10).data;
let isFarbling = false;
for (let i = 0; i < 100; i++) {
if (d[i * 4] !== 40 ||
d[i * 4 + 1] !== 40 ||
d[i * 4 + 2] !== 40 ||
d[i * 4 + 3] !== 255) {
isFarbling = true;
break;
}
}
_isCanvasFarblingActive = isFarbling;
this.releaseCanvas(c);

@@ -453,0 +462,0 @@ return _isCanvasFarblingActive;

{
"name": "konva",
"version": "10.0.11",
"version": "10.0.12",
"description": "HTML5 2d canvas library.",

@@ -5,0 +5,0 @@ "author": "Anton Lavrenov",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display