Skip to content

Commit

Permalink
Merge pull request #13399 from carolhmj/GUIInvalidateLinkedControlRec…
Browse files Browse the repository at this point in the history
…tBeforeMoving

Force the control's old rect position to be invalidated before moving
  • Loading branch information
sebavan committed Jan 3, 2023
2 parents c43ee29 + 8c7060a commit 83eef24
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions packages/dev/gui/src/2D/advancedDynamicTexture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,9 @@ export class AdvancedDynamicTexture extends DynamicTexture {
continue;
}
control.notRenderable = false;
if (this.useInvalidateRectOptimization) {
control.invalidateRect();
}

control._moveToProjectedPosition(projectedPosition);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/dev/gui/src/2D/controls/control.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1552,7 +1552,7 @@ export class Control implements IAnimatable {

/** @internal */
// eslint-disable-next-line @typescript-eslint/naming-convention
protected invalidateRect() {
public invalidateRect() {
this._transform();
if (this.host && this.host.useInvalidateRectOptimization) {
// Rotate by transform to get the measure transformed to global space
Expand Down

0 comments on commit 83eef24

Please sign in to comment.