mirror of
https://github.com/scratchfoundation/scratch-blocks.git
synced 2025-08-28 22:10:31 -04:00
adding additional type annotations
This commit is contained in:
parent
e5dfdf4658
commit
482c62dfa2
3 changed files with 15 additions and 2 deletions
|
@ -41,12 +41,16 @@ goog.require('goog.math.Coordinate');
|
|||
*/
|
||||
Blockly.BlockSvg = function() {
|
||||
// Create core elements for the block.
|
||||
/** @type {SVGElement} */
|
||||
this.svgGroup_ = Blockly.createSvgElement('g', {}, null);
|
||||
/** @type {SVGElement} */
|
||||
this.svgPathDark_ = Blockly.createSvgElement('path',
|
||||
{'class': 'blocklyPathDark', 'transform': 'translate(1,1)'},
|
||||
this.svgGroup_);
|
||||
/** @type {SVGElement} */
|
||||
this.svgPath_ = Blockly.createSvgElement('path', {'class': 'blocklyPath'},
|
||||
this.svgGroup_);
|
||||
/** @type {SVGElement} */
|
||||
this.svgPathLight_ = Blockly.createSvgElement('path',
|
||||
{'class': 'blocklyPathLight'}, this.svgGroup_);
|
||||
this.svgPath_.tooltip = this;
|
||||
|
|
|
@ -76,17 +76,22 @@ Blockly.FieldImage.prototype.init = function(block) {
|
|||
}
|
||||
this.sourceBlock_ = block;
|
||||
// Build the DOM.
|
||||
/** @type {SVGElement} */
|
||||
this.fieldGroup_ = Blockly.createSvgElement('g', {}, null);
|
||||
if (!this.visible_) {
|
||||
this.fieldGroup_.style.display = 'none';
|
||||
}
|
||||
/** @type {SVGElement} */
|
||||
this.imageElement_ = Blockly.createSvgElement('image',
|
||||
{'height': this.height_ + 'px',
|
||||
'width': this.width_ + 'px'}, this.fieldGroup_);
|
||||
this.setValue(this.src_);
|
||||
if (goog.userAgent.GECKO) {
|
||||
// Due to a Firefox bug which eats mouse events on image elements,
|
||||
// a transparent rectangle needs to be placed on top of the image.
|
||||
/**
|
||||
* Due to a Firefox bug which eats mouse events on image elements,
|
||||
* a transparent rectangle needs to be placed on top of the image.
|
||||
* @type {SVGElement}
|
||||
*/
|
||||
this.rectElement_ = Blockly.createSvgElement('rect',
|
||||
{'height': this.height_ + 'px',
|
||||
'width': this.width_ + 'px',
|
||||
|
|
|
@ -158,10 +158,12 @@ Blockly.WorkspaceSvg.prototype.createDom = function(opt_backgroundClass) {
|
|||
<g class="blocklyBubbleCanvas"></g>
|
||||
[Scrollbars may go here]
|
||||
</g>
|
||||
@type {SVGElement}
|
||||
*/
|
||||
this.svgGroup_ = Blockly.createSvgElement('g',
|
||||
{'class': 'blocklyWorkspace'}, null);
|
||||
if (opt_backgroundClass) {
|
||||
/** @type {SVGElement} */
|
||||
this.svgBackground_ = Blockly.createSvgElement('rect',
|
||||
{'height': '100%', 'width': '100%',
|
||||
'class': opt_backgroundClass}, this.svgGroup_);
|
||||
|
@ -170,8 +172,10 @@ Blockly.WorkspaceSvg.prototype.createDom = function(opt_backgroundClass) {
|
|||
'url(#' + this.options.gridPattern.id + ')';
|
||||
}
|
||||
}
|
||||
/** @type {SVGElement} */
|
||||
this.svgBlockCanvas_ = Blockly.createSvgElement('g',
|
||||
{'class': 'blocklyBlockCanvas'}, this.svgGroup_, this);
|
||||
/** @type {SVGElement} */
|
||||
this.svgBubbleCanvas_ = Blockly.createSvgElement('g',
|
||||
{'class': 'blocklyBubbleCanvas'}, this.svgGroup_, this);
|
||||
var bottom = Blockly.Scrollbar.scrollbarThickness;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue