mirror of
https://github.com/lospec/pixel-editor.git
synced 2023-08-10 21:12:51 +03:00
Started canvas trimming
This commit is contained in:
@ -182,4 +182,12 @@ function resizeImageData (image, width, height, algorithm) {
|
||||
resize(image, result)
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
function getPixelPosition(index) {
|
||||
let linearIndex = index / 4;
|
||||
let y = linearIndex / layers[0].canvasSize[0];
|
||||
let x = linearIndex - y * layers[0].canvasSize[0];
|
||||
|
||||
return [x, y];
|
||||
}
|
Reference in New Issue
Block a user