source: imaps-frontend/node_modules/konva/lib/index-node.js

main
Last change on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 705 bytes
RevLine 
[d565449]1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3const _FullInternals_1 = require("./_FullInternals");
4const Canvas = require("canvas");
5const canvas = Canvas['default'] || Canvas;
6global.DOMMatrix = canvas.DOMMatrix;
7const isNode = typeof global.document === 'undefined';
8if (isNode) {
9 _FullInternals_1.Konva.Util['createCanvasElement'] = () => {
10 const node = canvas.createCanvas(300, 300);
11 if (!node['style']) {
12 node['style'] = {};
13 }
14 return node;
15 };
16 _FullInternals_1.Konva.Util.createImageElement = () => {
17 const node = new canvas.Image();
18 return node;
19 };
20}
21module.exports = _FullInternals_1.Konva;
Note: See TracBrowser for help on using the repository browser.