flip tabs with part
This commit is contained in:
parent
cdb0051ebd
commit
d32cf6a2fb
1 changed files with 25 additions and 8 deletions
|
|
@ -361,7 +361,8 @@
|
||||||
func.opFlip = () => {
|
func.opFlip = () => {
|
||||||
let { process } = current;
|
let { process } = current;
|
||||||
let { ops, op2 } = process;
|
let { ops, op2 } = process;
|
||||||
let add2 = op2.length === 0; // add flip singleton to b-side
|
// add flip singleton to b-side
|
||||||
|
let add2 = op2.length === 0;
|
||||||
let axis = poppedRec.axis;
|
let axis = poppedRec.axis;
|
||||||
flipping = true;
|
flipping = true;
|
||||||
process.camZAnchor = {
|
process.camZAnchor = {
|
||||||
|
|
@ -369,13 +370,29 @@
|
||||||
bottom: "top",
|
bottom: "top",
|
||||||
middle: "middle"
|
middle: "middle"
|
||||||
}[process.camZAnchor];
|
}[process.camZAnchor];
|
||||||
switch (axis) {
|
// flip tabs
|
||||||
case 'X':
|
API.widgets.all().forEach(widget => {
|
||||||
API.selection.rotate(Math.PI, 0, 0);
|
let anno = API.widgets.annotate(widget.id).tab || [];
|
||||||
break;
|
for (let tab of anno) {
|
||||||
case 'Y':
|
let wtp = widget.tabs[tab.id].box.position;
|
||||||
API.selection.rotate(0, Math.PI, 0);
|
if (axis === 'X') {
|
||||||
break;
|
tab.pos.y = -tab.pos.y;
|
||||||
|
wtp.y = -wtp.y;
|
||||||
|
}
|
||||||
|
if (axis === 'Y') {
|
||||||
|
tab.pos.x = -tab.pos.x;
|
||||||
|
wtp.x = -wtp.x;
|
||||||
|
}
|
||||||
|
tab.pos.z = widget.bounds.max.z - tab.pos.z;
|
||||||
|
wtp.z = widget.bounds.max.z - wtp.z;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// flip widget
|
||||||
|
if (axis === 'X') {
|
||||||
|
API.selection.rotate(Math.PI, 0, 0);
|
||||||
|
}
|
||||||
|
if (axis === 'Y') {
|
||||||
|
API.selection.rotate(0, Math.PI, 0);
|
||||||
}
|
}
|
||||||
flipping = false;
|
flipping = false;
|
||||||
process.ops = op2;
|
process.ops = op2;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue