mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-01-11 10:39:56 -05:00
Fix lint issue and update maximums
Inferring from the issue, the maximum seems to be 100, not 255 (default for set is 50 and change is 10). Changed that. A comment line was too long (thanks lint) so it has now been reworded.
This commit is contained in:
parent
e30e5809d1
commit
8a77329c79
1 changed files with 4 additions and 4 deletions
|
@ -375,7 +375,7 @@ class Scratch3PenBlocks {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The pen "change pen transparency by {number}" block changes the "transparency" of the pen, related to the RGB value.
|
* The pen "change pen transparency by {number}" block changes the RGBA "transparency" of the pen.
|
||||||
* @param {object} args - the block arguments.
|
* @param {object} args - the block arguments.
|
||||||
* @property {number} TRANSPARENCY - the amount of desired transparency change.
|
* @property {number} TRANSPARENCY - the amount of desired transparency change.
|
||||||
* @param {object} util - utility object provided by the runtime.
|
* @param {object} util - utility object provided by the runtime.
|
||||||
|
@ -383,12 +383,12 @@ class Scratch3PenBlocks {
|
||||||
changePenTransparencyBy (args, util) {
|
changePenTransparencyBy (args, util) {
|
||||||
const penState = this._getPenState(util.target);
|
const penState = this._getPenState(util.target);
|
||||||
|
|
||||||
penState.penAttributes.color4f[3] = penState.penAttributes.color4f[3] + (args.TRANSPARENCY / 255);
|
penState.penAttributes.color4f[3] = penState.penAttributes.color4f[3] + (args.TRANSPARENCY / 100);
|
||||||
this._updatePenColor(penState);
|
this._updatePenColor(penState);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The pen "set pen transparency to {number}" block sets the "transparency" of the pen, related to the RGB value.
|
* The pen "set pen transparency to {number}" block sets the RGBA "transparency" of the pen.
|
||||||
* @param {object} args - the block arguments.
|
* @param {object} args - the block arguments.
|
||||||
* @property {number} TRANSPARENCY - the amount of desired transparency change.
|
* @property {number} TRANSPARENCY - the amount of desired transparency change.
|
||||||
* @param {object} util - utility object provided by the runtime.
|
* @param {object} util - utility object provided by the runtime.
|
||||||
|
@ -396,7 +396,7 @@ class Scratch3PenBlocks {
|
||||||
setPenTransparencyTo (args, util) {
|
setPenTransparencyTo (args, util) {
|
||||||
const penState = this._getPenState(util.target);
|
const penState = this._getPenState(util.target);
|
||||||
|
|
||||||
penState.penAttributes.color4f[3] = args.TRANSPARENCY / 255;
|
penState.penAttributes.color4f[3] = args.TRANSPARENCY / 100;
|
||||||
this._updatePenColor(penState);
|
this._updatePenColor(penState);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue