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

@shapediver/viewer.rendering-engine.canvas-engine

Package Overview
Dependencies
Maintainers
5
Versions
217
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@shapediver/viewer.rendering-engine.canvas-engine - npm Package Compare versions

Comparing version 1.12.3 to 1.12.4

4

dist/implementation/Canvas.js

@@ -5,2 +5,3 @@ "use strict";

class Canvas {
// #region Constructors (1)
constructor(_id, _originalDefinition, _canvasElement) {

@@ -20,2 +21,4 @@ this._id = _id;

}
// #endregion Constructors (1)
// #region Public Accessors (2)
get canvasElement() {

@@ -27,2 +30,3 @@ return this._canvasElement;

}
// #endregion Public Accessors (2)
reset() {

@@ -29,0 +33,0 @@ var _a;

@@ -7,2 +7,14 @@ import { UuidGenerator } from '@shapediver/viewer.shared.services';

protected readonly _uuidGenerator: UuidGenerator;
/**
* Creates a canvas object that could in the future be expanded to hold more information
* The definition of the canvas can be:
* - empty: A canvas is created with an unique ID.
* - string:
* - If a canvas with this ID was created, this canvas is returned.
* - If there is an HTMLCanvasElement in the document with this ID, this is used.
* - If there is no HTMLElement found in the document with this ID, a canvas with ID will be created.
* - HTMLCanvasElement: A Canvas Object will be created with this element. If there is no ID, one will be generated.
*
* @param canvasDefinition the definition of this canvas
*/
createCanvasObject(canvasDefinition?: string | HTMLCanvasElement, storageId?: string): string;

@@ -9,0 +21,0 @@ getCanvas(storageId: string): ICanvas;

@@ -15,8 +15,25 @@ "use strict";

constructor() {
// #region Properties (4)
this._canvasDictionary = {};
this._uuidGenerator = tsyringe_1.container.resolve(viewer_shared_services_1.UuidGenerator);
// #endregion Public Methods (2)
}
// #endregion Properties (4)
// #region Public Methods (2)
/**
* Creates a canvas object that could in the future be expanded to hold more information
* The definition of the canvas can be:
* - empty: A canvas is created with an unique ID.
* - string:
* - If a canvas with this ID was created, this canvas is returned.
* - If there is an HTMLCanvasElement in the document with this ID, this is used.
* - If there is no HTMLElement found in the document with this ID, a canvas with ID will be created.
* - HTMLCanvasElement: A Canvas Object will be created with this element. If there is no ID, one will be generated.
*
* @param canvasDefinition the definition of this canvas
*/
createCanvasObject(canvasDefinition, storageId) {
storageId = storageId !== undefined && this._uuidGenerator.validate(storageId) ? storageId : this._uuidGenerator.create();
if (canvasDefinition instanceof HTMLCanvasElement) {
// a canvas was provided
const canvasElement = canvasDefinition;

@@ -35,2 +52,3 @@ if (!canvasElement.id)

if (canvasElement instanceof HTMLCanvasElement) {
// id of a canvas was provided
this._canvasDictionary[storageId] = new Canvas_1.Canvas(id, canvasDefinition, canvasElement);

@@ -40,2 +58,3 @@ return storageId;

else if (!canvasElement) {
// no HTMLElement could be found, create Canvas with the id
this._canvasDictionary[storageId] = new Canvas_1.Canvas(id, canvasDefinition);

@@ -42,0 +61,0 @@ return storageId;

6

package.json
{
"name": "@shapediver/viewer.rendering-engine.canvas-engine",
"version": "1.12.3",
"version": "1.12.4",
"description": "",

@@ -39,7 +39,7 @@ "keywords": [],

"dependencies": {
"@shapediver/viewer.shared.services": "1.12.3",
"@shapediver/viewer.shared.services": "1.12.4",
"gl-matrix": "3.3.0",
"tsyringe": "^4.5.0"
},
"gitHead": "d30a08bc7f5cef8205ddb7fc1c303178389672a0"
"gitHead": "8eaec07cb71ad7cda7a2b0c09d3a32c2b00bd205"
}

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