git.y1.nz

SameBoy

Accurate GB/GBC emulator
download: https://git.y1.nz/archives/sameboy.tar.gz
README | Files | Log | Refs | LICENSE

Cocoa/GBDeleteButtonCell.m

      1 #import "GBDeleteButtonCell.h"
      2 
      3 @implementation GBDeleteButtonCell
      4 
      5 // Image scaling is broken on some older macOS versions
      6 - (void)drawImage:(NSImage *)image withFrame:(NSRect)frame inView:(NSView *)controlView
      7 {
      8     double size = 13;
      9     unsigned offset = 1;
     10     if (@available(macOS 10.10, *)) {
     11         size = 15;
     12         offset = 0;
     13     }
     14     frame.origin.x += round((frame.size.width - size) / 2) + offset;
     15     frame.origin.y += round((frame.size.height - size) / 2) - offset;
     16     frame.size.width = frame.size.height = size;
     17     [super drawImage:image withFrame:frame inView:controlView];
     18 }
     19 
     20 - (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
     21 {
     22     [self drawImage:self.image withFrame:cellFrame inView:controlView];
     23 }
     24 
     25 -(void)drawBezelWithFrame:(NSRect)frame inView:(NSView *)controlView
     26 {
     27     
     28 }
     29 
     30 @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.