From a7cd5a240aa431a4e4c7bbe5fba171bb42de6e2e Mon Sep 17 00:00:00 2001 From: David Rowe Date: Thu, 15 Mar 2018 17:31:02 +1300 Subject: [PATCH] Fix "text" overlay not clipping to right and bottom margins --- interface/resources/qml/hifi/overlays/TextOverlay.qml | 1 + interface/src/ui/overlays/TextOverlay.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/interface/resources/qml/hifi/overlays/TextOverlay.qml b/interface/resources/qml/hifi/overlays/TextOverlay.qml index 301a2aa0bf..2fdc9c7cbb 100644 --- a/interface/resources/qml/hifi/overlays/TextOverlay.qml +++ b/interface/resources/qml/hifi/overlays/TextOverlay.qml @@ -20,6 +20,7 @@ Overlay { font.family: "Helvetica" font.pixelSize: 18 lineHeight: 18 + clip: true } } diff --git a/interface/src/ui/overlays/TextOverlay.cpp b/interface/src/ui/overlays/TextOverlay.cpp index fba36f0c77..e7641ab2c2 100644 --- a/interface/src/ui/overlays/TextOverlay.cpp +++ b/interface/src/ui/overlays/TextOverlay.cpp @@ -40,8 +40,10 @@ QUrl const TextOverlay::URL(QString("hifi/overlays/TextOverlay.qml")); * * @property {number} margin=0 - Sets the leftMargin and topMargin values, in pixels. * Write-only. - * @property {number} leftMargin=0 - The left margin's size, in pixels. Write-only. - * @property {number} topMargin=0 - The top margin's size, in pixels. Write-only. + * @property {number} leftMargin=0 - The left margin's size, in pixels. This value is also used for the right margin. + * Write-only. + * @property {number} topMargin=0 - The top margin's size, in pixels. This value is also used for the bottom margin. + * Write-only. * @property {string} text="" - The text to display. Text does not automatically wrap; use \n for a line break. Text * is clipped to the bounds. Write-only. * @property {number} font.size=18 - The size of the text, in pixels. Write-only.