mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 21:50:37 +00:00
Fix a bug that prevented changing the color of the selected text of a
text view via drag and drop. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29250 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
4a2f89d5e6
commit
56dd03f899
2 changed files with 17 additions and 4 deletions
|
@ -4819,10 +4819,17 @@ other than copy/paste or dragging. */
|
|||
|
||||
- (BOOL) performDragOperation: (id <NSDraggingInfo>)sender
|
||||
{
|
||||
/* In general, the position where the dragging source was dropped is given by
|
||||
_dragTargetLocation. However, when dragging a color onto a text view, the
|
||||
cursor is not updated, since the color change always effects the current
|
||||
selection and hence _dragTargetLocation==NSNotFound in that case. */
|
||||
NSRange sourceRange = [self selectedRange];
|
||||
NSRange changeRange = NSMakeRange(_dragTargetLocation, 0);
|
||||
[self _draggingReleaseInsertionPoint];
|
||||
[self setSelectedRange: changeRange];
|
||||
if (_dragTargetLocation != NSNotFound)
|
||||
{
|
||||
NSRange changeRange = NSMakeRange(_dragTargetLocation, 0);
|
||||
[self _draggingReleaseInsertionPoint];
|
||||
[self setSelectedRange: changeRange];
|
||||
}
|
||||
|
||||
if ([sender draggingSource] == self &&
|
||||
([sender draggingSourceOperationMask] & NSDragOperationGeneric))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue