Skip to content

Instantly share code, notes, and snippets.

@inklesspen
Created March 19, 2009 03:00
Show Gist options
  • Save inklesspen/81561 to your computer and use it in GitHub Desktop.
Save inklesspen/81561 to your computer and use it in GitHub Desktop.
@implementation TileDocumentView : CPView
{
}
- (void)mouseDragged:(CPEvent)anEvent
{
var point = [self convertPoint:[anEvent locationInWindow] fromView:nil];
var view = [self hitTest: point];
if (view && view != self)
{
if ([[view tile] draggable])
{
CPLog.info("Dragging");
[[CPPasteboard pasteboardWithName:CPDragPboard] declareTypes:[TileDragType] owner:self];
[self dragView:view
at:[[view] frame].origin
offset:CGPointMakeZero()
event:anEvent
pasteboard:nil
source:self
slideBack:YES];
}
}
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment