SameBoy | Accurate GB/GBC emulator |
| download: https://git.y1.nz/archives/sameboy.tar.gz | |
| README | Files | Log | Refs | LICENSE |
Cocoa/GBCenteredTextCell.m
1 #import "GBCenteredTextCell.h"
2
3 @implementation GBCenteredTextCell
4 - (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
5 {
6 double height = round([self.attributedStringValue size].height);
7 cellFrame.origin.y += (cellFrame.size.height - height) / 2;
8 cellFrame.size.height = height;
9 [super drawInteriorWithFrame:cellFrame inView:controlView];
10 }
11
12
13 - (void)selectWithFrame:(NSRect)rect inView:(NSView *)controlView editor:(NSText *)textObj delegate:(id)delegate start:(NSInteger)selStart length:(NSInteger)selLength
14 {
15 double height = round([self.attributedStringValue size].height);
16 rect.origin.y += (rect.size.height - height) / 2;
17 rect.size.height = height;
18 [super selectWithFrame:rect inView:controlView editor:textObj delegate:delegate start:selStart length:selLength];
19 }
20
21 - (void)editWithFrame:(NSRect)rect inView:(NSView *)controlView editor:(NSText *)textObj delegate:(id)delegate event:(NSEvent *)event
22 {
23 double height = round([self.attributedStringValue size].height);
24 rect.origin.y += (rect.size.height - height) / 2;
25 rect.size.height = height;
26 [super editWithFrame:rect inView:controlView editor:textObj delegate:delegate event:event];
27
28 }
29 @end
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.