Pārlūkot izejas kodu

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

Entities positioned above the ground were going off the screen.
master
Fen Dweller pirms 5 gadiem
vecāks
revīzija
047e89a3f4
1 mainītis faili ar 6 papildinājumiem un 9 dzēšanām
  1. +6
    -9
      macrovision.js

+ 6
- 9
macrovision.js Parādīt failu

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

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)
updateSizes(true);
@@ -3358,6 +3352,9 @@ function fitEntities(targetEntities, manual = false, factor = 1.1) {
count += 1;
});

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



Notiek ielāde…
Atcelt
Saglabāt