mirror of
https://github.com/lospec/pixel-editor.git
synced 2023-08-10 21:12:51 +03:00
Added latest log loading
Fixed sprite scaling bug
This commit is contained in:
@ -7,6 +7,7 @@ rawFile.onreadystatechange = function ()
|
||||
if(rawFile.status === 200 || rawFile.status == 0)
|
||||
{
|
||||
var allText = rawFile.responseText;
|
||||
|
||||
document.getElementById("latest-update").innerHTML = allText;
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
|
@ -201,6 +201,10 @@ function newPixel (width, height, editorMode, fileContent = null) {
|
||||
else {
|
||||
switchMode(false);
|
||||
}
|
||||
|
||||
// Resetting history
|
||||
undoStates = [];
|
||||
redoStates = [];
|
||||
}
|
||||
|
||||
function newFromTemplate(preset, x, y) {
|
||||
|
@ -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.
|
||||
|
@ -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) {
|
||||
|
Reference in New Issue
Block a user