source: imaps-frontend/node_modules/html2canvas/dist/lib/dom/replaced-elements/svg-element-container.js

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

F4 Finalna Verzija

  • Property mode set to 100644
File size: 1.8 KB
Line 
1"use strict";
2var __extends = (this && this.__extends) || (function () {
3 var extendStatics = function (d, b) {
4 extendStatics = Object.setPrototypeOf ||
5 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6 function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7 return extendStatics(d, b);
8 };
9 return function (d, b) {
10 if (typeof b !== "function" && b !== null)
11 throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12 extendStatics(d, b);
13 function __() { this.constructor = d; }
14 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15 };
16})();
17Object.defineProperty(exports, "__esModule", { value: true });
18exports.SVGElementContainer = void 0;
19var element_container_1 = require("../element-container");
20var bounds_1 = require("../../css/layout/bounds");
21var SVGElementContainer = /** @class */ (function (_super) {
22 __extends(SVGElementContainer, _super);
23 function SVGElementContainer(context, img) {
24 var _this = _super.call(this, context, img) || this;
25 var s = new XMLSerializer();
26 var bounds = bounds_1.parseBounds(context, img);
27 img.setAttribute('width', bounds.width + "px");
28 img.setAttribute('height', bounds.height + "px");
29 _this.svg = "data:image/svg+xml," + encodeURIComponent(s.serializeToString(img));
30 _this.intrinsicWidth = img.width.baseVal.value;
31 _this.intrinsicHeight = img.height.baseVal.value;
32 _this.context.cache.addImage(_this.svg);
33 return _this;
34 }
35 return SVGElementContainer;
36}(element_container_1.ElementContainer));
37exports.SVGElementContainer = SVGElementContainer;
38//# sourceMappingURL=svg-element-container.js.map
Note: See TracBrowser for help on using the repository browser.