fix behavior of simple click within selected text; optimize setNeedsDisplayInRect: when called with empty rect

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29914 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Doug Simons 2010-03-12 22:50:42 +00:00
parent e01753e955
commit 9b229c81f5
3 changed files with 13 additions and 2 deletions

View file

@ -1,3 +1,11 @@
2005-03-12 Doug Simons <doug.simons@testplant.com>
* Source/NSTextView.m: (-mouseDown:): Only try to drag text
if the user starts by dragging the mouse. A simple click within
the selection will now set the insertion point.
* Source/NSView.m: (-setNeedsDisplayInRect:): Avoid unnecessary
work when invalid rectangle is empty.
2005-03-11 Doug Simons <doug.simons@testplant.com>
* Source/NSClipView.m: Call isFlipped rather than accessing

View file

@ -5257,7 +5257,7 @@ other than copy/paste or dragging. */
currentEvent = [_window nextEventMatchingMask: mask
untilDate: [NSDate distantFuture]
inMode: NSEventTrackingRunLoopMode
dequeue: YES];
dequeue: NO];
if ([currentEvent type] == NSLeftMouseDragged)
{
if (![self dragSelectionWithEvent: theEvent
@ -5269,7 +5269,7 @@ other than copy/paste or dragging. */
return;
}
}
else
/* Enter modal loop tracking the mouse */
{
unsigned int mask = NSLeftMouseDraggedMask | NSLeftMouseUpMask

View file

@ -2721,6 +2721,9 @@ in the main thread.
*/
- (void) setNeedsDisplayInRect: (NSRect)invalidRect
{
if (NSIsEmptyRect(invalidRect))
return; // avoid unnecessary work when rectangle is empty
NSValue *v = [[NSValue alloc]
initWithBytes: &invalidRect
objCType: @encode(NSRect)];