mirror of
https://github.com/google/blockly.git
synced 2026-01-10 18:37:09 +01:00
Fix zelos flickering in flyout (#3448)
This commit is contained in:
@@ -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));
|
||||
};
|
||||
|
||||
|
||||
@@ -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_);
|
||||
|
||||
Reference in New Issue
Block a user