浏览代码

Implicitly increase size to compensate for moving an entity below the y=0 line

This was, previously, explicitly handled with a factor of (1 / (1 - x)).
I just regex'd away these factors, so there are probably a few errors.
tags/v0.1.0
Fen Dweller 5 年前
父节点
当前提交
f3a58d3cab
共有 2 个文件被更改,包括 284 次插入284 次删除
  1. +4
    -4
      macrovision.js
  2. +280
    -280
      presets/characters.js

+ 4
- 4
macrovision.js 查看文件

@@ -110,7 +110,9 @@ function updateEntityElement(entity, element, zIndex) {
element.style.left = position.x + "px";
element.style.top = position.y + "px";
const pixels = math.divide(entity.views[view].height, config.height) * (canvasHeight - 50);
const bonus = (entity.views[view].image.extra ? entity.views[view].image.extra : 1);
const extra = entity.views[view].image.extra;
const bottom = entity.views[view].image.bottom;
const bonus = (extra ? extra : 1) * (1 / (1 - (bottom ? bottom : 0)));
element.style.setProperty("--height", pixels * bonus + "px");
element.style.setProperty("--extra", pixels * bonus - pixels + "px");

@@ -1382,10 +1384,8 @@ function fitWorld(manual=false, factor=1.1) {

let extra = entity.views[view].image.extra;
extra = extra === undefined ? 1 : extra;
let bottom = entity.views[view].image.bottom;
bottom = bottom === undefined ? 0 : bottom;

max = fitMode.binop(max, math.multiply(extra * (1 - bottom), entity.views[view].height.toNumber("meter")));
max = fitMode.binop(max, math.multiply(extra, entity.views[view].height.toNumber("meter")));
count += 1;
});



+ 280
- 280
presets/characters.js
文件差异内容过多而无法显示
查看文件


正在加载...
取消
保存