Skip to content

Commit 3ed3602

Browse files
committed
ic led components animation
hotfix
1 parent 24bca5b commit 3ed3602

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

static/component.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -552,12 +552,12 @@ class IntegratedComponent extends Component {
552552
let width = maxX - minX, height = maxY - minY;
553553
let ratio = (this.size - 2*IntegratedComponent.PADDING) / Math.max(width, height);
554554
let realWidth = width*ratio, realHeight = height*ratio;
555-
let startX = this.targetX + (this.size - realWidth) / 2, startY = this.targetY + (this.size - realHeight) / 2;
555+
let startX = this.x + (this.size - realWidth) / 2, startY = this.y + (this.size - realHeight) / 2;
556556

557557
this.ledSurfaces.length = 0;
558558
this.ledComponents.forEach(component => {
559-
component.surfaces[0].realX = startX + (component.targetX - minX) * ratio;
560-
component.surfaces[0].realY = startY + (component.targetY - minY) * ratio;
559+
component.surfaces[0].realX = startX + (component.x - minX) * ratio;
560+
component.surfaces[0].realY = startY + (component.y - minY) * ratio;
561561
component.surfaces[0].realWidth = component.size * ratio;
562562
component.surfaces[0].realHeight = component.size * ratio;
563563
this.ledSurfaces.push(component.surfaces[0]);

0 commit comments

Comments
 (0)