Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@meta2d/core

Package Overview
Dependencies
Maintainers
2
Versions
72
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@meta2d/core - npm Package Compare versions

Comparing version 1.0.29 to 1.0.30

2

package.json
{
"name": "@meta2d/core",
"version": "1.0.29",
"version": "1.0.30",
"description": "@meta2d/core: Powerful, Beautiful, Simple, Open - Web-Based 2D At Its Best .",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -276,10 +276,21 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

function renderPenRaw(pen) {
if (pen.calculative.singleton && pen.calculative.singleton.div) {
try {
handleSaveImg(pen);
if (pen.thumbImg) {
var img = new Image();
img.crossOrigin =
pen.crossOrigin === 'undefined'
? undefined
: pen.crossOrigin || 'anonymous';
img.src = pen.thumbImg;
pen.calculative.img = img;
}
else {
if (pen.calculative.singleton && pen.calculative.singleton.div) {
try {
handleSaveImg(pen);
}
catch (e) {
console.warn(e);
pen.calculative.img = null;
}
}
catch (e) {
console.warn(e);
pen.calculative.img = null;
}
}

@@ -289,3 +300,3 @@ }

return __awaiter(this, void 0, void 0, function () {
var iframeHtml, iframeBody, iframeScrollY, iframeScrollX, canvas, img;
var iframeHtml, iframeBody, iframeScrollY, iframeScrollX, fillContent, canvas, img;
return __generator(this, function (_a) {

@@ -298,5 +309,9 @@ switch (_a.label) {

iframeScrollX = iframeHtml.document.documentElement.scrollLeft;
fillContent = document.createElement('div');
// 把需要转换成图片的元素内容赋给创建的元素
fillContent.innerHTML = iframeBody.outerHTML;
document.body.appendChild(fillContent);
iframeHtml.document.domain = getRootDomain();
if (!globalThis.html2canvas) return [3 /*break*/, 2];
return [4 /*yield*/, globalThis.html2canvas(iframeBody, {
return [4 /*yield*/, globalThis.html2canvas(fillContent, {
allowTaint: true,

@@ -308,9 +323,6 @@ useCORS: true,

y: iframeScrollY,
foreignObjectRendering: true,
// foreignObjectRendering: true,
})];
case 1:
canvas = _a.sent();
canvas.getContext('2d', {
willReadFrequently: true,
});
img = new Image();

@@ -325,2 +337,3 @@ img.crossOrigin =

}
document.body.removeChild(fillContent);
_a.label = 2;

@@ -327,0 +340,0 @@ case 2: return [2 /*return*/];

@@ -227,2 +227,3 @@ import { Point } from '../point';

template?: boolean;
thumbImg?: string;
calculative?: {

@@ -229,0 +230,0 @@ x?: number;

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

Sorry, the diff of this file is not supported yet

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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