threads: made alpha values optional for generating costume pixels, none = solid

pull/95/head
jmoenig 2020-10-04 12:58:18 +02:00
rodzic c42ce28388
commit 97ff986cda
3 zmienionych plików z 10 dodań i 4 usunięć

Wyświetl plik

@ -2,10 +2,15 @@
## in development:
* **New Features:**
* **New Minor Features:**
* added "bar / lines" option for plotting charts in the "frequency distribution analysis" library
* new "add comment" option in the block context menu, thanks, Rob Fidler!
* new "48 kHz" option in the "sampling rate" dropdown
* **Notable Changes:**
* specifying alpha values are now optional for generating pixels in bitmaps (costumes), none means the pixel is solid
### 2020-10-04
* threads: made alpha values optional for generating costume pixels, none = solid
### 2020-09-28
* tweaked "frequency distribution analysis" library to plot lines in any color or style

Wyświetl plik

@ -9,7 +9,7 @@
<script src="src/symbols.js?version=2020-07-21"></script>
<script src="src/widgets.js?version=2020-07-27"></script>
<script src="src/blocks.js?version=2020-09-25"></script>
<script src="src/threads.js?version=2020-09-02"></script>
<script src="src/threads.js?version=2020-10-04"></script>
<script src="src/objects.js?version=2020-09-18"></script>
<script src="src/gui.js?version=2020-09-25"></script>
<script src="src/paint.js?version=2020-05-17"></script>

Wyświetl plik

@ -61,7 +61,7 @@ StageMorph, SpriteMorph, StagePrompterMorph, Note, modules, isString, copy, Map,
isNil, WatcherMorph, List, ListWatcherMorph, alert, console, TableMorph, BLACK,
TableFrameMorph, ColorSlotMorph, isSnapObject, newCanvas, Symbol, SVG_Costume*/
modules.threads = '2020-September-02';
modules.threads = '2020-October-04';
var ThreadManager;
var Process;
@ -5560,9 +5560,10 @@ Process.prototype.reportNewCostume = function (pixels, width, height, name) {
dta = ctx.createImageData(width, height);
for (i = 0; i < src.length; i += 1) {
px = src[i].asArray();
for (k = 0; k < 4; k += 1) {
for (k = 0; k < 3; k += 1) {
dta.data[(i * 4) + k] = px[k];
}
dta.data[i * 4 + 3] = (px[3] === undefined ? 255 : px[3]);
}
ctx.putImageData(dta, 0, 0);
return new Costume(