Skip to content

Commit e4f7458

Browse files
committed
Put back the code that vertically centers texts.
1 parent 0c6f3f5 commit e4f7458

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

newIDE/app/src/ObjectsRendering/Renderers/RenderedCustomObjectInstance.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -665,6 +665,14 @@ export default class RenderedCustomObjectInstance extends RenderedInstance {
665665
childInstance.setCustomHeight(renderedInstance.getDefaultHeight());
666666
}
667667
renderedInstance.update();
668+
669+
if (childLayout.verticalLayout.anchorOrigin == null) {
670+
// This ensure objects are centered if their dimensions changed from the
671+
// custom ones (preferred ones).
672+
// For instance, text object dimensions change according to how the text is wrapped.
673+
childInstance.y = (height - renderedInstance._pixiObject.height) / 2;
674+
renderedInstance.update();
675+
}
668676
}
669677

670678
this._pixiObject.pivot.x = centerX;

0 commit comments

Comments
 (0)