mirror of
https://github.com/scratchfoundation/scratch-blocks.git
synced 2025-08-28 22:10:31 -04:00
Move stack glow size into a settable parameter like the colors.
This commit is contained in:
parent
7128298e1d
commit
1815177a39
4 changed files with 5 additions and 17 deletions
|
@ -96,8 +96,10 @@ Blockly.Colours = {
|
|||
"insertionMarkerOpacity": 0.2,
|
||||
"dragShadowOpacity": 0.3,
|
||||
"stackGlow": "#FFF200",
|
||||
"stackGlowSize": 1.3,
|
||||
"stackGlowOpacity": 1,
|
||||
"replacementGlow": "#FFFFFF",
|
||||
"replacementGlowSize": 2,
|
||||
"replacementGlowOpacity": 1,
|
||||
"colourPickerStroke": "#FFFFFF",
|
||||
// CSS colours: support RGBA
|
||||
|
|
|
@ -244,20 +244,6 @@ Blockly.OUTPUT_SHAPE_ROUND = 2;
|
|||
*/
|
||||
Blockly.OUTPUT_SHAPE_SQUARE = 3;
|
||||
|
||||
/**
|
||||
* Radius of stack glow, in px.
|
||||
* @type {number}
|
||||
* @const
|
||||
*/
|
||||
Blockly.STACK_GLOW_RADIUS = 1.3;
|
||||
|
||||
/**
|
||||
* Radius of replacement glow, in px.
|
||||
* @type {number}
|
||||
* @const
|
||||
*/
|
||||
Blockly.REPLACEMENT_GLOW_RADIUS = 2;
|
||||
|
||||
/**
|
||||
* ENUM for categories.
|
||||
* @const
|
||||
|
|
|
@ -135,7 +135,7 @@ Blockly.createDom_ = function(container, options) {
|
|||
'height': '160%', 'width': '180%', y: '-30%', x: '-40%'}, defs);
|
||||
options.stackGlowBlur = Blockly.utils.createSvgElement('feGaussianBlur',
|
||||
{'in': 'SourceGraphic',
|
||||
'stdDeviation': Blockly.STACK_GLOW_RADIUS}, stackGlowFilter);
|
||||
'stdDeviation': Blockly.Colours.stackGlowSize}, stackGlowFilter);
|
||||
// Set all gaussian blur pixels to 1 opacity before applying flood
|
||||
var componentTransfer = Blockly.utils.createSvgElement('feComponentTransfer', {'result': 'outBlur'}, stackGlowFilter);
|
||||
Blockly.utils.createSvgElement('feFuncA',
|
||||
|
@ -156,7 +156,7 @@ Blockly.createDom_ = function(container, options) {
|
|||
'height': '160%', 'width': '180%', y: '-30%', x: '-40%'}, defs);
|
||||
Blockly.utils.createSvgElement('feGaussianBlur',
|
||||
{'in': 'SourceGraphic',
|
||||
'stdDeviation': Blockly.REPLACEMENT_GLOW_RADIUS}, replacementGlowFilter);
|
||||
'stdDeviation': Blockly.Colours.replacementGlowSize}, replacementGlowFilter);
|
||||
// Set all gaussian blur pixels to 1 opacity before applying flood
|
||||
var componentTransfer = Blockly.utils.createSvgElement('feComponentTransfer',
|
||||
{'result': 'outBlur'}, replacementGlowFilter);
|
||||
|
|
|
@ -1658,7 +1658,7 @@ Blockly.WorkspaceSvg.prototype.updateStackGlowScale_ = function() {
|
|||
// No such def in the flyout workspace.
|
||||
if (this.options.stackGlowBlur) {
|
||||
this.options.stackGlowBlur.setAttribute('stdDeviation',
|
||||
Blockly.STACK_GLOW_RADIUS / this.scale
|
||||
Blockly.Colours.stackGlowSize / this.scale
|
||||
);
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue