列车调整
This commit is contained in:
parent
a59e51eafd
commit
2fd3f071e1
@ -112,11 +112,11 @@ class TrainBody extends Container {
|
|||||||
this.bodyRact.clear();
|
this.bodyRact.clear();
|
||||||
}
|
}
|
||||||
getBodyWH() {
|
getBodyWH() {
|
||||||
const bodyAWH = this.codeAGraph.getLocalBounds();
|
const bodyAWH = this.codeAGraph.localBoundsToCanvasPoints();
|
||||||
const bodyBWH = this.codeBGraph.getLocalBounds();
|
const bodyBWH = this.codeBGraph.localBoundsToCanvasPoints();
|
||||||
return {
|
return {
|
||||||
width: bodyAWH.width + bodyBWH.width + this.train.constDatas.bodyPadding * 2,
|
width: bodyAWH[1].x - bodyAWH[0].x + bodyBWH[1].x - bodyBWH[0].x,
|
||||||
height: bodyAWH.height + this.train.constDatas.bodyPadding * 2,
|
height: bodyAWH[2].y - bodyAWH[1].y,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
doRepaint() {
|
doRepaint() {
|
||||||
|
@ -128,12 +128,11 @@ class TrainBody extends Container {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getBodyWH(): bodyWH {
|
getBodyWH(): bodyWH {
|
||||||
const bodyAWH = this.codeAGraph.getLocalBounds();
|
const bodyAWH = this.codeAGraph.localBoundsToCanvasPoints();
|
||||||
const bodyBWH = this.codeBGraph.getLocalBounds();
|
const bodyBWH = this.codeBGraph.localBoundsToCanvasPoints();
|
||||||
return {
|
return {
|
||||||
width:
|
width: bodyAWH[1].x - bodyAWH[0].x + bodyBWH[1].x - bodyBWH[0].x,
|
||||||
bodyAWH.width + bodyBWH.width + this.train.constDatas.bodyPadding * 2,
|
height: bodyAWH[2].y - bodyAWH[1].y,
|
||||||
height: bodyAWH.height + this.train.constDatas.bodyPadding * 2,
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user