道岔单封边框
This commit is contained in:
parent
5afc6b59c2
commit
732b3fe34d
@ -253,6 +253,7 @@ export class Turnout extends JlGraphic {
|
||||
this.graphics.label.transformSave = true;
|
||||
this.graphics.label.name = 'label';
|
||||
this.addChild(this.graphics.label);
|
||||
this.addChild(this.graphics.labelRect);
|
||||
}
|
||||
|
||||
get code(): string {
|
||||
@ -295,8 +296,16 @@ export class Turnout extends JlGraphic {
|
||||
}
|
||||
if (this.states.ipSingleSwitchStusBlocked2) {
|
||||
this.graphics.labelRect.clear().lineStyle(1, '#f00');
|
||||
const { x, y, width, height } = this.graphics.label.getLocalBounds();
|
||||
this.graphics.labelRect.drawRect(x, y, width, height);
|
||||
const { width, height } = this.graphics.label.getLocalBounds();
|
||||
const { x, y } = this.graphics.label.transform.position;
|
||||
this.graphics.labelRect.drawRect(
|
||||
x - width / 2,
|
||||
y - height / 2,
|
||||
width,
|
||||
height
|
||||
);
|
||||
} else {
|
||||
this.graphics.labelRect.clear();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user