[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
GSSimpleLayoutManger.patch (mouse selection at EOL)
From: |
David Ayers |
Subject: |
GSSimpleLayoutManger.patch (mouse selection at EOL) |
Date: |
Mon, 30 Sep 2002 01:52:10 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2a) Gecko/20020910 |
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;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- GSSimpleLayoutManger.patch (mouse selection at EOL),
David Ayers <=