@@ -105,12 +105,6 @@ export class ConstantProvider extends BaseConstantProvider {
105105 /** The size of the selected glow. */
106106 SELECTED_GLOW_SIZE = 0.5 ;
107107
108- /** The replacement glow colour. */
109- REPLACEMENT_GLOW_COLOUR = '#fff200' ;
110-
111- /** The size of the selected glow. */
112- REPLACEMENT_GLOW_SIZE = 2 ;
113-
114108 /**
115109 * The ID of the selected glow filter, or the empty string if no filter is
116110 * set.
@@ -122,17 +116,6 @@ export class ConstantProvider extends BaseConstantProvider {
122116 */
123117 private selectedGlowFilter : SVGElement | null = null ;
124118
125- /**
126- * The ID of the replacement glow filter, or the empty string if no filter
127- * is set.
128- */
129- replacementGlowFilterId = '' ;
130-
131- /**
132- * The <filter> element to use for a replacement glow, or null if not set.
133- */
134- private replacementGlowFilter : SVGElement | null = null ;
135-
136119 /**
137120 * The object containing information about the hexagon used for a boolean
138121 * reporter block. Null before init is called.
@@ -269,26 +252,13 @@ export class ConstantProvider extends BaseConstantProvider {
269252 selectedGlowSize && ! isNaN ( selectedGlowSize )
270253 ? selectedGlowSize
271254 : this . SELECTED_GLOW_SIZE ;
272- this . REPLACEMENT_GLOW_COLOUR =
273- theme . getComponentStyle ( 'replacementGlowColour' ) ||
274- this . REPLACEMENT_GLOW_COLOUR ;
275- const replacementGlowSize = Number (
276- theme . getComponentStyle ( 'replacementGlowSize' ) ,
277- ) ;
278- this . REPLACEMENT_GLOW_SIZE =
279- replacementGlowSize && ! isNaN ( replacementGlowSize )
280- ? replacementGlowSize
281- : this . REPLACEMENT_GLOW_SIZE ;
282255 }
283256
284257 override dispose ( ) {
285258 super . dispose ( ) ;
286259 if ( this . selectedGlowFilter ) {
287260 dom . removeNode ( this . selectedGlowFilter ) ;
288261 }
289- if ( this . replacementGlowFilter ) {
290- dom . removeNode ( this . replacementGlowFilter ) ;
291- }
292262 }
293263
294264 override makeStartHat ( ) {
@@ -740,67 +710,6 @@ export class ConstantProvider extends BaseConstantProvider {
740710 this . selectedGlowFilterId = selectedGlowFilter . id ;
741711 this . selectedGlowFilter = selectedGlowFilter ;
742712
743- // Using a dilate distorts the block shape.
744- // Instead use a gaussian blur, and then set all alpha to 1 with a transfer.
745- const replacementGlowFilter = dom . createSvgElement (
746- Svg . FILTER ,
747- {
748- 'id' : 'blocklyReplacementGlowFilter' + this . randomIdentifier ,
749- 'height' : '160%' ,
750- 'width' : '180%' ,
751- 'y' : '-30%' ,
752- 'x' : '-40%' ,
753- } ,
754- defs ,
755- ) ;
756- dom . createSvgElement (
757- Svg . FEGAUSSIANBLUR ,
758- { 'in' : 'SourceGraphic' , 'stdDeviation' : this . REPLACEMENT_GLOW_SIZE } ,
759- replacementGlowFilter ,
760- ) ;
761- // Set all gaussian blur pixels to 1 opacity before applying flood
762- const replacementComponentTransfer = dom . createSvgElement (
763- Svg . FECOMPONENTTRANSFER ,
764- { 'result' : 'outBlur' } ,
765- replacementGlowFilter ,
766- ) ;
767- dom . createSvgElement (
768- Svg . FEFUNCA ,
769- { 'type' : 'table' , 'tableValues' : '0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1' } ,
770- replacementComponentTransfer ,
771- ) ;
772- // Color the highlight
773- dom . createSvgElement (
774- Svg . FEFLOOD ,
775- {
776- 'flood-color' : this . REPLACEMENT_GLOW_COLOUR ,
777- 'flood-opacity' : 1 ,
778- 'result' : 'outColor' ,
779- } ,
780- replacementGlowFilter ,
781- ) ;
782- dom . createSvgElement (
783- Svg . FECOMPOSITE ,
784- {
785- 'in' : 'outColor' ,
786- 'in2' : 'outBlur' ,
787- 'operator' : 'in' ,
788- 'result' : 'outGlow' ,
789- } ,
790- replacementGlowFilter ,
791- ) ;
792- dom . createSvgElement (
793- Svg . FECOMPOSITE ,
794- {
795- 'in' : 'SourceGraphic' ,
796- 'in2' : 'outGlow' ,
797- 'operator' : 'over' ,
798- } ,
799- replacementGlowFilter ,
800- ) ;
801- this . replacementGlowFilterId = replacementGlowFilter . id ;
802- this . replacementGlowFilter = replacementGlowFilter ;
803-
804713 if ( injectionDivIfIsParent ) {
805714 // If this renderer is for the parent workspace, add CSS variables scoped
806715 // to the injection div referencing the created patterns so that CSS can
@@ -809,10 +718,6 @@ export class ConstantProvider extends BaseConstantProvider {
809718 '--blocklySelectedGlowFilter' ,
810719 `url(#${ this . selectedGlowFilterId } )` ,
811720 ) ;
812- injectionDivIfIsParent . style . setProperty (
813- '--blocklyReplacementGlowFilter' ,
814- `url(#${ this . replacementGlowFilterId } )` ,
815- ) ;
816721 }
817722 }
818723
@@ -904,10 +809,6 @@ export class ConstantProvider extends BaseConstantProvider {
904809 `fill: none;` ,
905810 `filter: var(--blocklySelectedGlowFilter);` ,
906811 `}` ,
907-
908- `${ selector } .blocklyReplaceable>.blocklyPath {` ,
909- `filter: var(--blocklyReplacementGlowFilter);` ,
910- `}` ,
911812 ] ;
912813 }
913814}
0 commit comments