kopia lustrzana https://github.com/backface/turtlestitch
				
				
				
			let "getImageAttribute" deal with null costumes
							rodzic
							
								
									223e493316
								
							
						
					
					
						commit
						530afb1a60
					
				|  | @ -64,6 +64,7 @@ | |||
| 
 | ||||
| ### 2019-04-09 | ||||
| * Blocks, Objects, Threads: new "getImageAttribute" reporter primitive | ||||
| * Objects, Threads: let "getImageAttribute" deal with null costumes  | ||||
| 
 | ||||
| ### 2019-04-08 | ||||
| * Blocks, Objects, Threads: new "getSoundAttribute" reporter primitive | ||||
|  |  | |||
|  | @ -8910,14 +8910,19 @@ Costume.prototype.rasterized = function () { | |||
| }; | ||||
| 
 | ||||
| Costume.prototype.pixels = function () { | ||||
|     var i, | ||||
|         pixels = [], | ||||
|         src = this.contents.getContext('2d').getImageData( | ||||
|             0, | ||||
|             0, | ||||
|             this.contents.width, | ||||
|             this.contents.height | ||||
|         ); | ||||
|     var pixels = [], | ||||
|         src, | ||||
|         i; | ||||
| 
 | ||||
|     if (!this.contents.width || !this.contents.height) { | ||||
|         return pixels; | ||||
|     } | ||||
|     src = this.contents.getContext('2d').getImageData( | ||||
|         0, | ||||
|         0, | ||||
|         this.contents.width, | ||||
|         this.contents.height | ||||
|     ); | ||||
|     for (i = 0; i < src.data.length; i += 4) { | ||||
|         pixels.push(new List([ | ||||
|             src.data[i], | ||||
|  |  | |||
|  | @ -4345,7 +4345,7 @@ Process.prototype.reportGetImageAttribute = function (choice, name) { | |||
|                     this.blockReceiver().costumes.asArray(), | ||||
|                     function (c) {return c.name === name.toString(); } | ||||
|                 ) | ||||
|             ), | ||||
|             ) || new Costume(), | ||||
|         option = this.inputOption(choice); | ||||
| 
 | ||||
|     switch (option) { | ||||
|  |  | |||
		Ładowanie…
	
		Reference in New Issue
	
	 jmoenig
						jmoenig