mirror of
https://github.com/JannisX11/blockbench.git
synced 2024-11-27 04:21:46 +08:00
Flipping locators now also flips name
This commit is contained in:
parent
3208e0e9bd
commit
e576099c1c
@ -49,6 +49,13 @@ class Locator extends NonGroup {
|
||||
flip(axis, center) {
|
||||
var offset = this.from[axis] - center
|
||||
this.from[axis] = center - offset;
|
||||
// Name
|
||||
if (axis == 0 && this.name.includes('right')) {
|
||||
this.name = this.name.replace(/right/g, 'left').replace(/2$/, '');
|
||||
} else if (axis == 0 && this.name.includes('left')) {
|
||||
this.name = this.name.replace(/left/g, 'right').replace(/2$/, '');
|
||||
}
|
||||
this.createUniqueName();
|
||||
return this;
|
||||
}
|
||||
getWorldCenter() {
|
||||
|
Loading…
Reference in New Issue
Block a user