Test text rendering
This commit is contained in:
@@ -151,23 +151,24 @@
|
||||
const getValues = () => {
|
||||
if(!pixels) return null;
|
||||
|
||||
const right = parseInt(elRight.value) || 0;
|
||||
const bottom = parseInt(elBottom.value) || 0;
|
||||
|
||||
let tileWidth, tileHeight, columnCount, rowCount;
|
||||
if(elDefineBySize.checked) {
|
||||
console.log('Defining by size');
|
||||
tileWidth = parseInt(elTileWidth.value) || 0;
|
||||
tileHeight = parseInt(elTileHeight.value) || 0;
|
||||
columnCount = Math.floor(imageWidth / tileWidth);
|
||||
rowCount = Math.floor(imageHeight / tileHeight);
|
||||
columnCount = Math.floor((imageWidth - right) / tileWidth);
|
||||
rowCount = Math.floor((imageHeight - bottom) / tileHeight);
|
||||
} else {
|
||||
console.log('Defining by count');
|
||||
columnCount = parseInt(elColumnCount.value) || 0;
|
||||
rowCount = parseInt(elRowCount.value) || 0;
|
||||
tileWidth = Math.floor(imageWidth / columnCount);
|
||||
tileHeight = Math.floor(imageHeight / rowCount);
|
||||
tileWidth = Math.floor((imageWidth - right) / columnCount);
|
||||
tileHeight = Math.floor((imageHeight - bottom) / rowCount);
|
||||
}
|
||||
|
||||
const right = parseInt(elRight.value) || 0;
|
||||
const bottom = parseInt(elBottom.value) || 0;
|
||||
|
||||
const scale = parseInt(elScale.value) || 1;
|
||||
const scaledWidth = imageWidth * scale;
|
||||
|
||||
Reference in New Issue
Block a user