Skip to content

Commit

Permalink
feat: added blocklyHighlighted CSS class to highlighted block's roo…
Browse files Browse the repository at this point in the history
…t… (#8407)

* fix: added 'blocklyHighlighted' CSS class to highlighted block's root svg

* fix: added 'blocklyHighlighted' CSS class to highlighted block's root svg

* fix: added 'blocklyHighlighted' CSS class to highlighted block's root svg

* fix: added 'blocklyHighlighted' CSS class to highlighted block's root svg

* fix: added 'blocklyHighlighted' CSS class to highlighted block's root svg
  • Loading branch information
Shreshthaaa authored Aug 14, 2024
1 parent 731fb40 commit 64fd9ad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 3 additions & 0 deletions core/renderers/common/path_object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,14 +170,17 @@ export class PathObject implements IPathObject {
*
* @param enable True if highlighted.
*/

updateHighlighted(enable: boolean) {
if (enable) {
this.svgPath.setAttribute(
'filter',
'url(#' + this.constants.embossFilterId + ')',
);
this.setClass_('blocklyHighlighted', true);
} else {
this.svgPath.setAttribute('filter', 'none');
this.setClass_('blocklyHighlighted', false);
}
}

Expand Down
6 changes: 1 addition & 5 deletions core/renderers/geras/path_object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,10 @@ export class PathObject extends BasePathObject {
}

override updateHighlighted(highlighted: boolean) {
super.updateHighlighted(highlighted);
if (highlighted) {
this.svgPath.setAttribute(
'filter',
'url(#' + this.constants.embossFilterId + ')',
);
this.svgPathLight.style.display = 'none';
} else {
this.svgPath.setAttribute('filter', 'none');
this.svgPathLight.style.display = 'inline';
}
}
Expand Down

0 comments on commit 64fd9ad

Please sign in to comment.