Hello,
could someone with more insight of the text system verify this minor
patch to the layout manager?
It fixes the insertion point positioning behavior when clicking beyond
the last character of a line in an NSTextView.
Cheers,
Dave
Index: gnustep.local/core/gui/Source/GSSimpleLayoutManager.m
===================================================================
RCS file: /cvsroot/gnustep/gnustep/core/gui/Source/GSSimpleLayoutManager.m,v
retrieving revision 1.34
diff -u -r1.34 GSSimpleLayoutManager.m
--- gnustep.local/core/gui/Source/GSSimpleLayoutManager.m 11 Sep 2002 20:26:27
-0000 1.34
+++ gnustep.local/core/gui/Source/GSSimpleLayoutManager.m 29 Sep 2002 22:56:35
+-0000
@@ -242,11 +242,11 @@
}
if (x <= fmin)
{
- return MAX(0, min - 1);
+ return MAX(0, min);
}
if (x >= fmax)
{
- return MAX(0, max);
+ return MAX(0, max - 1);
}
if (range.length == 1)
{
@@ -675,10 +675,14 @@
fmax = NSMaxY([[_lineLayoutInformation lastObject] lineFragmentRect]);
if (y >= fmax)
+ {
return max;
+ }
if (y <= fmin)
+ {
return min;
+ }
// this should give a good starting index for binary search
i = (int)((max - min) * (y - fmin) / (fmax - fmin)) + min;