Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Refactored TUITextRenderer to use NSImage

  • Loading branch information...
commit db1b0d1caa2d6bdc9c62c089db8b75deb7c535b3 1 parent 484c9cc
@jspahrsummers jspahrsummers authored
Showing with 3 additions and 6 deletions.
  1. +3 −6 lib/UIKit/TUITextRenderer+Event.m
View
9 lib/UIKit/TUITextRenderer+Event.m
@@ -18,7 +18,6 @@
#import "ABActiveRange.h"
#import "CoreText+Additions.h"
#import "TUICGAdditions.h"
-#import "TUIImage.h"
#import "TUINSView.h"
#import "TUINSWindow.h"
#import "TUIView+Private.h"
@@ -87,12 +86,12 @@ - (CFIndex)stringIndexForEvent:(NSEvent *)event
return nil;
}
-- (TUIImage *)dragImageForSelection:(NSRange)selection
+- (NSImage *)dragImageForSelection:(NSRange)selection
{
CGRect b = self.view.frame;
_flags.drawMaskDragSelection = 1;
- TUIImage *image = TUIGraphicsDrawAsImage(b.size, ^{
+ NSImage *image = TUIGraphicsDrawAsImage(b.size, ^{
[self draw];
});
_flags.drawMaskDragSelection = 0;
@@ -117,12 +116,10 @@ - (BOOL)beginWaitForDragInRange:(NSRange)range string:(NSString *)string
CFIndex saveEnd = _selectionEnd;
_selectionStart = range.location;
_selectionEnd = range.location + range.length;
- TUIImage *dragImage = [self dragImageForSelection:range];
+ NSImage *image = [self dragImageForSelection:range];
_selectionStart = saveStart;
_selectionEnd = saveEnd;
- NSImage *image = [[NSImage alloc] initWithCGImage:dragImage.CGImage size:NSZeroSize];
-
[view.nsView dragImage:image
at:f.origin
offset:NSZeroSize

0 comments on commit db1b0d1

Please sign in to comment.
Something went wrong with that request. Please try again.