mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 00:51:02 +00:00
DnD cleanups and fixes.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@21028 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
960ae57b10
commit
b9c4cc1832
6 changed files with 125 additions and 61 deletions
|
@ -3613,18 +3613,40 @@ static inline float computePeriod(NSPoint mouseLocationWin,
|
|||
if ([self _writeRows: rows
|
||||
toPasteboard: pboard] == YES)
|
||||
{
|
||||
NSPoint p = NSZeroPoint;
|
||||
NSImage *dragImage =
|
||||
[self dragImageForRows: rows
|
||||
event: theEvent
|
||||
dragImageOffset: &p];
|
||||
NSPoint p = NSZeroPoint;
|
||||
NSImage *dragImage;
|
||||
NSSize s;
|
||||
|
||||
dragImage = [self dragImageForRows: rows
|
||||
event: theEvent
|
||||
dragImageOffset: &p];
|
||||
/*
|
||||
* Store image offset in s ... the returned
|
||||
* value is the position of the center of
|
||||
* the image, so we adjust to the bottom left
|
||||
* corner.
|
||||
*/
|
||||
s = [dragImage size];
|
||||
s.width = p.x - s.width/2;
|
||||
s.height = p.y - s.height/2;
|
||||
|
||||
/*
|
||||
* Find the current mouse location and adjust
|
||||
* it to determine the location of the bottom
|
||||
* left corner of the image in this view's
|
||||
* coordinate system.
|
||||
*/
|
||||
p = [self convertPoint:
|
||||
[theEvent locationInWindow] fromView: nil];
|
||||
p.x += s.width;
|
||||
p.y += s.height;
|
||||
|
||||
[self dragImage: dragImage
|
||||
at: NSZeroPoint
|
||||
offset: NSMakeSize(0, 0)
|
||||
event: theEvent
|
||||
pasteboard: pboard
|
||||
source: self
|
||||
at: p
|
||||
offset: NSMakeSize(0, 0)
|
||||
event: theEvent
|
||||
pasteboard: pboard
|
||||
source: self
|
||||
slideBack: YES];
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue