mirror of
https://github.com/JannisX11/blockbench.git
synced 2024-11-27 04:21:46 +08:00
Improve resize tool handling on inverted cubes
Fix material icons overflow if icon is missing
This commit is contained in:
parent
f1db906d82
commit
33f5a736d6
@ -298,6 +298,7 @@
|
||||
direction: ltr;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
text-rendering: optimizeLegibility;
|
||||
overflow: hidden;
|
||||
}
|
||||
i.fa_big {
|
||||
font-size: 18px;
|
||||
|
@ -842,9 +842,11 @@ class Cube extends OutlinerElement {
|
||||
return in_box;
|
||||
}
|
||||
resize(val, axis, negative, allow_negative, bidirectional) {
|
||||
var before = this.oldScale != undefined ? this.oldScale : this.size(axis);
|
||||
let before = this.oldScale != undefined ? this.oldScale : this.size(axis);
|
||||
if (before instanceof Array) before = before[axis];
|
||||
var modify = val instanceof Function ? val : n => (n+val)
|
||||
let is_inverted = before < 0;
|
||||
if (is_inverted) negative = !negative;
|
||||
let modify = val instanceof Function ? val : n => (n + val);
|
||||
|
||||
if (bidirectional) {
|
||||
|
||||
@ -852,8 +854,8 @@ class Cube extends OutlinerElement {
|
||||
let difference = modify(before) - before;
|
||||
if (negative) difference *= -1;
|
||||
|
||||
var from = center - (before/2) - difference;
|
||||
var to = center + (before/2) + difference;
|
||||
let from = center - (before/2) - difference;
|
||||
let to = center + (before/2) + difference;
|
||||
|
||||
if (Format.integer_size) {
|
||||
from = Math.round(from-this.from[axis])+this.from[axis];
|
||||
@ -866,7 +868,7 @@ class Cube extends OutlinerElement {
|
||||
}
|
||||
|
||||
} else if (!negative) {
|
||||
var pos = this.from[axis] + modify(before);
|
||||
let pos = this.from[axis] + modify(before);
|
||||
if (Format.integer_size) {
|
||||
pos = Math.round(pos-this.from[axis])+this.from[axis];
|
||||
}
|
||||
@ -876,7 +878,7 @@ class Cube extends OutlinerElement {
|
||||
this.to[axis] = this.from[axis];
|
||||
}
|
||||
} else {
|
||||
var pos = this.to[axis] + modify(-before);
|
||||
let pos = this.to[axis] + modify(-before);
|
||||
if (Format.integer_size) {
|
||||
pos = Math.round(pos-this.to[axis])+this.to[axis];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user