Fixed whatever problem was with texture loading.
This commit is contained in:
@@ -151,7 +151,7 @@
|
||||
const getValues = () => {
|
||||
if(!pixels) return null;
|
||||
|
||||
let tileWidth, tileHeight, columnCount, rowCount, right, bottom;
|
||||
let tileWidth, tileHeight, columnCount, rowCount;
|
||||
if(elDefineBySize.checked) {
|
||||
console.log('Defining by size');
|
||||
tileWidth = parseInt(elTileWidth.value) || 0;
|
||||
@@ -166,8 +166,8 @@
|
||||
tileHeight = Math.floor(imageHeight / rowCount);
|
||||
}
|
||||
|
||||
right = parseInt(elRight.value) || 0;
|
||||
bottom = parseInt(elBottom.value) || 0;
|
||||
const right = parseInt(elRight.value) || 0;
|
||||
const bottom = parseInt(elBottom.value) || 0;
|
||||
|
||||
const scale = parseInt(elScale.value) || 1;
|
||||
const scaledWidth = imageWidth * scale;
|
||||
@@ -177,13 +177,13 @@
|
||||
const scaledRight = right * scale;
|
||||
const scaledBottom = bottom * scale;
|
||||
|
||||
const u0 = tileWidth / imageWidth - (right / imageWidth);
|
||||
const v0 = tileHeight / imageHeight - (bottom / imageHeight);
|
||||
const u0 = (tileWidth / imageWidth);
|
||||
const v0 = (tileHeight / imageHeight);
|
||||
|
||||
const hoveredTileX = isNaN(hoveredX) || hoveredX < 0 ? 0 : hoveredX;
|
||||
const hoveredTileY = isNaN(hoveredY) || hoveredY < 0 ? 0 : hoveredY;
|
||||
const hoveredU0 = hoveredTileX * tileWidth / imageWidth;
|
||||
const hoveredV0 = hoveredTileY * tileHeight / imageHeight;
|
||||
const hoveredU0 = hoveredTileX * u0;
|
||||
const hoveredV0 = hoveredTileY * v0;
|
||||
const hoveredU1 = hoveredU0 + u0;
|
||||
const hoveredV1 = hoveredV0 + v0;
|
||||
const hoveredTileIndex = hoveredTileY * columnCount + hoveredTileX;
|
||||
|
||||
Reference in New Issue
Block a user