handle single values as greyscale when constructing a costume

pull/95/head
jmoenig 2021-01-26 08:36:00 +01:00
rodzic 7fcd947b0f
commit 33ba6f46e3
3 zmienionych plików z 8 dodań i 4 usunięć

Wyświetl plik

@ -4,12 +4,16 @@
* **Notable Changes:** * **Notable Changes:**
* hyperized image attribute reporter primitive (monadic) * hyperized image attribute reporter primitive (monadic)
* when constructing a costume from a pixel list handle single values as greyscale
* **Notable Fixes:** * **Notable Fixes:**
* fixed a glitch in the animation library's "sine in-out" easing function * fixed a glitch in the animation library's "sine in-out" easing function
* fixed a postMessage glitch in the API, thanks, Bernat! * fixed a postMessage glitch in the API, thanks, Bernat!
* **Translation Updates:** * **Translation Updates:**
* Tamil, thanks, Barthdry! * Tamil, thanks, Barthdry!
### 2021-01-26
* threads: handle single values as greyscale when constructing a costume from a pixel list
### 2021-01-25 ### 2021-01-25
* threads: hyperized image attribute reporter primitive (monadic) * threads: hyperized image attribute reporter primitive (monadic)
* pulled pending PRs * pulled pending PRs

Wyświetl plik

@ -9,7 +9,7 @@
<script src="src/symbols.js?version=2020-10-07"></script> <script src="src/symbols.js?version=2020-10-07"></script>
<script src="src/widgets.js?version=2021-01-05"></script> <script src="src/widgets.js?version=2021-01-05"></script>
<script src="src/blocks.js?version=2020-12-22"></script> <script src="src/blocks.js?version=2020-12-22"></script>
<script src="src/threads.js?version=2021-01-25"></script> <script src="src/threads.js?version=2021-01-26"></script>
<script src="src/objects.js?version=2021-01-05"></script> <script src="src/objects.js?version=2021-01-05"></script>
<script src="src/gui.js?version=2021-01-21"></script> <script src="src/gui.js?version=2021-01-21"></script>
<script src="src/paint.js?version=2020-05-17"></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, isNil, WatcherMorph, List, ListWatcherMorph, alert, console, TableMorph, BLACK,
TableFrameMorph, ColorSlotMorph, isSnapObject, newCanvas, Symbol, SVG_Costume*/ TableFrameMorph, ColorSlotMorph, isSnapObject, newCanvas, Symbol, SVG_Costume*/
modules.threads = '2021-January-25'; modules.threads = '2021-January-26';
var ThreadManager; var ThreadManager;
var Process; var Process;
@ -5922,9 +5922,9 @@ Process.prototype.reportNewCostume = function (pixels, width, height, name) {
src = pixels.itemsArray(); src = pixels.itemsArray();
dta = ctx.createImageData(width, height); dta = ctx.createImageData(width, height);
for (i = 0; i < src.length; i += 1) { for (i = 0; i < src.length; i += 1) {
px = src[i].itemsArray(); px = src[i] instanceof List ? src[i].itemsArray() : [src[i]];
for (k = 0; k < 3; k += 1) { for (k = 0; k < 3; k += 1) {
dta.data[(i * 4) + k] = +px[k]; dta.data[(i * 4) + k] = px[k] === undefined ? +px[0] : +px[k];
} }
dta.data[i * 4 + 3] = (px[3] === undefined ? 255 : +px[3]); dta.data[i * 4 + 3] = (px[3] === undefined ? 255 : +px[3]);
} }