Fix zelos flickering in flyout (#3448)

This commit is contained in:
Sam El-Husseini
2019-11-19 08:41:00 -08:00
committed by GitHub
parent 70c24cf94e
commit 24627f0b3e
2 changed files with 12 additions and 10 deletions

View File

@@ -585,13 +585,13 @@ Blockly.Flyout.prototype.addBlockListeners_ = function(root, block, rect) {
this.blockMouseDown_(block)));
this.listeners_.push(Blockly.bindEventWithChecks_(rect, 'mousedown', null,
this.blockMouseDown_(block)));
this.listeners_.push(Blockly.bindEvent_(root, 'mouseover', block,
this.listeners_.push(Blockly.bindEvent_(root, 'mouseenter', block,
block.addSelect));
this.listeners_.push(Blockly.bindEvent_(root, 'mouseout', block,
this.listeners_.push(Blockly.bindEvent_(root, 'mouseleave', block,
block.removeSelect));
this.listeners_.push(Blockly.bindEvent_(rect, 'mouseover', block,
this.listeners_.push(Blockly.bindEvent_(rect, 'mouseenter', block,
block.addSelect));
this.listeners_.push(Blockly.bindEvent_(rect, 'mouseout', block,
this.listeners_.push(Blockly.bindEvent_(rect, 'mouseleave', block,
block.removeSelect));
};

View File

@@ -103,12 +103,14 @@ Blockly.zelos.PathObject.prototype.flipRTL = function() {
Blockly.zelos.PathObject.prototype.updateSelected = function(enable) {
this.setClass_('blocklySelected', enable);
if (enable) {
this.svgPathSelected_ =
/** @type {!SVGElement} */ (this.svgPath.cloneNode(true));
this.svgPathSelected_.setAttribute('fill', 'none');
this.svgPathSelected_.setAttribute('filter',
'url(#' + this.constants_.highlightGlowFilterId + ')');
this.svgRoot.appendChild(this.svgPathSelected_);
if (!this.svgPathSelected_) {
this.svgPathSelected_ =
/** @type {!SVGElement} */ (this.svgPath.cloneNode(true));
this.svgPathSelected_.setAttribute('fill', 'none');
this.svgPathSelected_.setAttribute('filter',
'url(#' + this.constants_.highlightGlowFilterId + ')');
this.svgRoot.appendChild(this.svgPathSelected_);
}
} else {
if (this.svgPathSelected_) {
this.svgRoot.removeChild(this.svgPathSelected_);