Fixed rounded corners in Metal

This commit is contained in:
Lior Halphon 2018-06-17 23:16:34 +03:00
parent a37a0b1b00
commit a4bfb026a8
5 changed files with 11 additions and 24 deletions

View File

@ -314,6 +314,8 @@ static void printImage(GB_gameboy_t *gb, uint32_t *image, uint8_t height,
NSMutableParagraphStyle *paragraph_style = [[NSMutableParagraphStyle alloc] init];
[paragraph_style setLineSpacing:2];
self.mainWindow.backgroundColor = [NSColor blackColor];
self.debuggerSideViewInput.font = [NSFont userFixedPitchFontOfSize:12];
self.debuggerSideViewInput.textColor = [NSColor whiteColor];
self.debuggerSideViewInput.defaultParagraphStyle = paragraph_style;

View File

@ -49,18 +49,12 @@
<view key="contentView" id="gIp-Ho-8D9">
<rect key="frame" x="0.0" y="0.0" width="160" height="144"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<customView id="KTk-4M-J7t" customClass="GBBorderView">
<rect key="frame" x="0.0" y="0.0" width="160" height="144"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view id="uqf-pe-VAF" customClass="GBView">
<rect key="frame" x="0.0" y="0.0" width="160" height="144"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
</view>
</subviews>
</customView>
</subviews>
</view>
<connections>
<outlet property="delegate" destination="-2" id="jvM-lC-fKb"/>

View File

@ -1,5 +0,0 @@
#import <Cocoa/Cocoa.h>
@interface GBBorderView : NSView
@end

View File

@ -1,11 +0,0 @@
#import "GBBorderView.h"
@implementation GBBorderView
- (void)drawRect:(NSRect)dirtyRect {
[[NSColor blackColor] setFill];
NSRectFill(dirtyRect);
[super drawRect:dirtyRect];
}
@end

View File

@ -71,6 +71,13 @@ static const vector_float2 rect[] =
[self loadShader];
}
- (void)addSubview:(NSView *)view
{
/* Fixes rounded corners */
[super addSubview:view];
[self setWantsLayer:YES];
}
- (void) loadShader
{
NSError *error = nil;