From 862a3578ffd05eba859e6f699365fdb10131f4da Mon Sep 17 00:00:00 2001 From: Alexander Malmberg Date: Fri, 21 Nov 2003 23:37:16 +0000 Subject: [PATCH] Tweak size calculation so that the insertion point doesn't disappear at the end of field editors. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@18101 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 5 +++++ Source/NSTextView.m | 13 ++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 0b6f29f02..6d894e02d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2003-11-19 21:53 Alexander Malmberg + + * Source/NSTextView.m (-sizeToFit): If we are horizontally resizable + and the inset width is 0, increase our width by 1. + 2003-11-19 17:06 Alexander Malmberg * Tools/GNUmakefile, Tools/example.m, Tools/exampleInfo.plist, diff --git a/Source/NSTextView.m b/Source/NSTextView.m index 6568f3e83..d75741bb5 100644 --- a/Source/NSTextView.m +++ b/Source/NSTextView.m @@ -1432,7 +1432,18 @@ incorrectly. */ if (!_tf.is_horizontally_resizable) size.width = _bounds.size.width; else - size.width += 2 * _textContainerInset.width; + { + size.width += 2 * _textContainerInset.width; + + /* + The +1 is to make sure that we always have one extra point on the right + where we can draw the insertion pointer for a character that touches + the right edge. This is a bit of a hack, but the insertion pointer + often disappears in field editors without this. + */ + if (!_textContainerInset.width) + size.width += 1; + } if (!_tf.is_vertically_resizable) size.height = _bounds.size.height;