From 1641a0516d9e8228a0189a83a688532d6554d271 Mon Sep 17 00:00:00 2001 From: hyche Date: Thu, 23 Nov 2017 18:43:22 +0100 Subject: [PATCH] Fix aligning when text growing more than the right bound.. because the bound scrolls to the current cursor to view the text (ScrollToOffset). Follow up #12608 Signed-off-by: Augustin Cavalier --- src/kits/interface/TextInput.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/kits/interface/TextInput.cpp b/src/kits/interface/TextInput.cpp index 6ed6455a50..ecfc4d0847 100644 --- a/src/kits/interface/TextInput.cpp +++ b/src/kits/interface/TextInput.cpp @@ -182,12 +182,12 @@ _BTextInput_::AlignTextRect() break; case B_ALIGN_RIGHT: - hInset = textRect.right - textFontWidth; + hInset = textRect.Width() - textFontWidth; hInset -= be_control_look->DefaultLabelSpacing(); break; case B_ALIGN_CENTER: - hInset = (textRect.right - textFontWidth) / 2.0; + hInset = (textRect.Width() - textFontWidth) / 2.0; break; default: