From 0230a4c192e9e9a0cd9399337cb170234997a21d Mon Sep 17 00:00:00 2001 From: Sam El-Husseini Date: Wed, 15 Apr 2020 19:46:11 -0700 Subject: [PATCH] Update IPathObject to include properties (#3822) * Update IPathObject to include properties * Fix ipathobject svgpath --- core/renderers/common/i_path_object.js | 32 ++++++++++++++++++++++++++ core/renderers/common/path_object.js | 2 +- core/renderers/geras/path_object.js | 2 +- 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/core/renderers/common/i_path_object.js b/core/renderers/common/i_path_object.js index 82a58f513..8b18426cf 100644 --- a/core/renderers/common/i_path_object.js +++ b/core/renderers/common/i_path_object.js @@ -27,6 +27,38 @@ goog.requireType('Blockly.Theme'); */ Blockly.blockRendering.IPathObject = function(_root, _constants) {}; +/** + * The primary path of the block. + * @type {!SVGElement} + */ +Blockly.blockRendering.IPathObject.prototype.svgPath; + +/** + * The renderer's constant provider. + * @type {!Blockly.blockRendering.ConstantProvider} + */ +Blockly.blockRendering.IPathObject.prototype.constants; + +/** + * The primary path of the block. + * @type {!Blockly.Theme.BlockStyle} + */ +Blockly.blockRendering.IPathObject.prototype.style; + +/** + * Holds the cursors svg element when the cursor is attached to the block. + * This is null if there is no cursor on the block. + * @type {SVGElement} + */ +Blockly.blockRendering.IPathObject.prototype.cursorSvg; + +/** + * Holds the markers svg element when the marker is attached to the block. + * This is null if there is no marker on the block. + * @type {SVGElement} + */ +Blockly.blockRendering.IPathObject.prototype.markerSvg; + /** * Set the path generated by the renderer onto the respective SVG element. * @param {string} pathString The path. diff --git a/core/renderers/common/path_object.js b/core/renderers/common/path_object.js index 73d1cc732..602f27448 100644 --- a/core/renderers/common/path_object.js +++ b/core/renderers/common/path_object.js @@ -43,7 +43,7 @@ Blockly.blockRendering.PathObject = function(root, style, constants) { /** * The primary path of the block. - * @type {SVGElement} + * @type {!SVGElement} * @package */ this.svgPath = Blockly.utils.dom.createSvgElement('path', diff --git a/core/renderers/geras/path_object.js b/core/renderers/geras/path_object.js index 76884c9bc..eed4775fe 100644 --- a/core/renderers/geras/path_object.js +++ b/core/renderers/geras/path_object.js @@ -54,7 +54,7 @@ Blockly.geras.PathObject = function(root, style, constants) { /** * The primary path of the block. - * @type {SVGElement} + * @type {!SVGElement} * @package */ this.svgPath = Blockly.utils.dom.createSvgElement('path',