File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11{
22 "name" : " pietron" ,
3- "version" : " 1.0.0 " ,
3+ "version" : " 1.0.1 " ,
44 "description" : " Cross-platform IDE for Piet." ,
55 "main" : " src/main.js" ,
66 "repository" : {
Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ const createCanvas = (width, height) => {
6565
6666const createFromBitmap = bitmap => {
6767 bitmap = transpose ( bitmap ) ;
68- const [ width , height ] = [ bitmap . length , bitmap [ 0 ] . length ] ;
68+ const [ height , width ] = [ bitmap . length , bitmap [ 0 ] . length ] ;
6969 setCanvasWidth ( width , false ) ;
7070 setCanvasHeight ( height , false ) ;
7171 for ( let i = 0 ; i < height ; i ++ ) {
Original file line number Diff line number Diff line change @@ -72,8 +72,7 @@ const fileToBitmap = async path => {
7272 for ( let i = 0 ; i < fieldWidth ; i ++ ) {
7373 const row = [ ] ;
7474 for ( let j = 0 ; j < fieldHeight ; j ++ ) {
75- // const hex = img.bitmap.data.readUInt32BE(img.getPixelIndex(i * codelSize, j * codelSize));
76- const hex = img . getPixelColor ( i * codelSize , j * codelSize ) ;
75+ const hex = img . bitmap . data . readUInt32BE ( img . getPixelIndex ( i * codelSize , j * codelSize ) ) ;
7776 const color = hexToPietColor ( hex ) ;
7877 row . push ( color > - 1 ? color : 18 ) ;
7978 }
You can’t perform that action at this time.
0 commit comments