mirror of
https://github.com/JannisX11/blockbench.git
synced 2025-02-11 16:12:06 +08:00
Fix knife tool on cubes issues
This commit is contained in:
parent
b31ff76124
commit
91000d50d7
@ -751,10 +751,10 @@ class KnifeToolCubeContext {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
addPoint(data) {
|
addPoint(data) {
|
||||||
|
if (!data?.element) return;
|
||||||
if (!this.first_point_set) {
|
if (!this.first_point_set) {
|
||||||
this.first_point_set = true;
|
this.first_point_set = true;
|
||||||
} else {
|
} else {
|
||||||
//this.hover(data);
|
|
||||||
this.apply();
|
this.apply();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -772,10 +772,11 @@ class KnifeToolCubeContext {
|
|||||||
let duplicate = this.cube.duplicate();
|
let duplicate = this.cube.duplicate();
|
||||||
selected.push(duplicate);
|
selected.push(duplicate);
|
||||||
elements.push(duplicate);
|
elements.push(duplicate);
|
||||||
let offset_lerp = Math.getLerp(this.cube.from[this.axis], this.cube.to[this.axis], this.offset);
|
let offset = this.offset + this.cube.origin[this.axis];
|
||||||
|
let offset_lerp = Math.getLerp(this.cube.from[this.axis], this.cube.to[this.axis], offset);
|
||||||
|
|
||||||
this.cube.to[this.axis] = this.offset;
|
this.cube.to[this.axis] = offset;
|
||||||
duplicate.from[this.axis] = this.offset;
|
duplicate.from[this.axis] = offset;
|
||||||
|
|
||||||
function modifyUV(face, index, inverted) {
|
function modifyUV(face, index, inverted) {
|
||||||
index = (index - (face.rotation/90) + 8) % 4;
|
index = (index - (face.rotation/90) + 8) % 4;
|
||||||
|
Loading…
Reference in New Issue
Block a user