Added latest log loading

Fixed sprite scaling bug
This commit is contained in:
unsettledgames
2021-04-28 23:39:14 +02:00
parent 7a975976cb
commit 07f36cf7cb
13 changed files with 96 additions and 11 deletions

View File

@ -7,6 +7,7 @@ rawFile.onreadystatechange = function ()
if(rawFile.status === 200 || rawFile.status == 0)
{
var allText = rawFile.responseText;
document.getElementById("latest-update").innerHTML = allText;
}
}

View File

@ -169,7 +169,6 @@ window.addEventListener("mouseup", function (mouseEvent) {
}, false);
// TODO: Make it snap to the pixel grid
function setPreviewPosition(preview, size){
let toAdd = 0;

View File

@ -201,6 +201,10 @@ function newPixel (width, height, editorMode, fileContent = null) {
else {
switchMode(false);
}
// Resetting history
undoStates = [];
redoStates = [];
}
function newFromTemplate(preset, x, y) {

View File

@ -113,8 +113,6 @@ function pbRemoveColours() {
coloursList.removeChild(coloursList.children[startIndex]);
}
clearBorders();
// TODO: make it so that ramps update correctly (change start and end indexes if necessary)
}
/** Starts selecting a ramp. Saves the data needed to draw the outline.

View File

@ -20,6 +20,8 @@ function openResizeSpriteWindow() {
// Computing the current ratio
currentRatio = layers[0].canvasSize[0] / layers[0].canvasSize[1];
console.log("Current ratio: " + currentRatio);
// Initializing the input fields
data.width = layers[0].canvasSize[0];
data.height = layers[1].canvasSize[1];
@ -232,7 +234,7 @@ function changedWidthPercentage(event) {
console.log("old value: " + oldValue + ", ratio: " + ratio);
newHeight = startData.height * ratio;
newHeightPerc = data.widthPercentage / currentRatio;
newHeightPerc = data.widthPercentage;
newWidth = startData.width * ratio;
if (keepRatio) {
@ -262,7 +264,7 @@ function changedHeightPercentage(event) {
ratio = data.heightPercentage / oldValue;
newWidth = startData.width * ratio;
newWidthPerc = data.heightPercentage * currentRatio;
newWidthPerc = data.heightPercentage;
newHeight = startData.height * ratio;
if (keepRatio) {