From cce473f025b3c75b662b28f93fa6120063f27832 Mon Sep 17 00:00:00 2001
From: hy che <cvghy116@gmail.com>
Date: Fri, 24 Nov 2017 19:43:02 +0100
Subject: [PATCH 2/2] TextInput: Fix text alignment when typing or removing.
Align when it is B_ALIGN_RIGHT or text width is smaller than bounding width, it doesn't
align with B_ALIGN_LEFT as it is the default behavior.
Refix #13796
---
src/kits/interface/TextInput.cpp | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/kits/interface/TextInput.cpp b/src/kits/interface/TextInput.cpp
index d744595..3dda891 100644
a
|
b
|
_BTextInput_::KeyDown(const char* bytes, int32 numBytes)
|
116 | 116 | |
117 | 117 | default: |
118 | 118 | BTextView::KeyDown(bytes, numBytes); |
119 | | AlignTextRect(); |
| 119 | if (Alignment() == B_ALIGN_LEFT) |
| 120 | break; |
| 121 | if (Alignment() == B_ALIGN_RIGHT || TextRect().Width() <= Bounds().Width()) |
| 122 | AlignTextRect(); |
120 | 123 | break; |
121 | 124 | } |
122 | 125 | } |