Przeglądaj źródła

Fix auto-fit/zoom working incorrectly with the y-axis locked

Entities positioned above the ground were going off the screen.
master
Fen Dweller 5 lat temu
rodzic
commit
047e89a3f4
1 zmienionych plików z 6 dodań i 9 usunięć
  1. +6
    -9
      macrovision.js

+ 6
- 9
macrovision.js Wyświetl plik

@@ -1550,15 +1550,9 @@ function displayEntity(entity, view, x, y, selectEntity = false, refresh = false
entity.dirty = true; entity.dirty = true;


if (refresh && config.autoFitAdd) { if (refresh && config.autoFitAdd) {
const x = parseFloat(selected.dataset.x);
const y = parseFloat(selected.dataset.y);

config.x = x;
config.y = y;

const entity = entities[selected.dataset.key];
const height = math.multiply(entity.views[entity.view].height, 1.1);
setWorldHeight(config.height, height);
let targets = {};
targets[entityIndex - 1] = entity;
fitEntities(targets);
} }
if (refresh) if (refresh)
updateSizes(true); updateSizes(true);
@@ -3358,6 +3352,9 @@ function fitEntities(targetEntities, manual = false, factor = 1.1) {
count += 1; count += 1;
}); });


if (config.lockYAxis) {
minY = 0;
}
let ySize = (maxY - minY) * factor; let ySize = (maxY - minY) * factor;
let xSize = (maxX - minX) * factor; let xSize = (maxX - minX) * factor;




Ładowanie…
Anuluj
Zapisz