虚拟计轴为红色

This commit is contained in:
joylink_zhaoerwei 2023-08-08 16:58:22 +08:00
parent 8abb01a1c1
commit b3c7646fba

View File

@ -29,6 +29,7 @@ export const AxleCountingConsts = {
radius: 6,
borderWidth: 1,
circleColorBlue: '0x08F80D',
circleColorRed: '0xff0000',
codeColor: '0xF48815',
codeFontSize: 22,
codeOffsetY: 30,
@ -47,23 +48,28 @@ class TwoCircleGraphic extends Container {
this.addChild(this.circleB);
this.addChild(this.line);
}
draw(): void {
this.drawCircle(this.circleA);
this.drawCircle(this.circleB);
draw(invent: boolean): void {
this.drawCircle(this.circleA, invent);
this.drawCircle(this.circleB, invent);
this.circleA.position.set(-12, 0);
this.circleB.position.set(12, 0);
this.line.clear();
this.line.lineStyle(1, new Color(AxleCountingConsts.circleColorBlue));
let color = AxleCountingConsts.circleColorBlue;
if (invent) {
color = AxleCountingConsts.circleColorRed;
}
this.line.lineStyle(1, new Color(color));
this.line.moveTo(-24, 0);
this.line.lineTo(24, 0);
}
drawCircle(circle: Graphics): void {
drawCircle(circle: Graphics, invent: boolean): void {
circle.clear();
circle.lineStyle(
AxleCountingConsts.borderWidth,
new Color(AxleCountingConsts.circleColorBlue)
);
circle.beginFill(AxleCountingConsts.circleColorBlue, 1);
let color = AxleCountingConsts.circleColorBlue;
if (invent) {
color = AxleCountingConsts.circleColorRed;
}
circle.lineStyle(AxleCountingConsts.borderWidth, new Color(color));
circle.beginFill(color, 1);
circle.drawCircle(0, 0, AxleCountingConsts.radius);
circle.endFill;
}
@ -89,7 +95,7 @@ export class AxleCounting extends JlGraphic {
return this.getDatas<IAxleCountingData>();
}
doRepaint(): void {
this.twoCircle.draw();
this.twoCircle.draw(this.datas.invent);
}
loadRelations(): void {
if (this.datas.axleCountingRef.length) {