Skip to content

Commit 1cf9a27

Browse files
committed
[Shapes] Wrap Text shape and don't center it on x and y
1 parent cff6ac5 commit 1cf9a27

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

meshroom/ui/qml/Shapes/Viewer/Layers/TextLayer.qml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,14 @@ BaseLayer {
1616
id: textLayer
1717

1818
Text {
19-
x: textLayer.observation.center.x - implicitWidth * 0.5 // Center text horizontally
20-
y: textLayer.observation.center.y - implicitHeight * 0.5 // Center text vertically
19+
width: ShapeViewerHelper.containerWidth - textLayer.observation.center.x
20+
height: ShapeViewerHelper.containerHeight - textLayer.observation.center.y
21+
22+
x: textLayer.observation.center.x
23+
y: textLayer.observation.center.y
2124
text: textLayer.observation.content || "Undefined"
2225
color: textLayer.properties.color || textLayer.defaultColor
23-
wrapMode: Text.NoWrap
26+
wrapMode: Text.Wrap
2427
font.family: textLayer.properties.fontFamily || "Arial"
2528
font.pixelSize: getScaledFontSize()
2629
}

0 commit comments

Comments
 (0)