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]; NSMutableParagraphStyle *paragraph_style = [[NSMutableParagraphStyle alloc] init];
[paragraph_style setLineSpacing:2]; [paragraph_style setLineSpacing:2];
self.mainWindow.backgroundColor = [NSColor blackColor];
self.debuggerSideViewInput.font = [NSFont userFixedPitchFontOfSize:12]; self.debuggerSideViewInput.font = [NSFont userFixedPitchFontOfSize:12];
self.debuggerSideViewInput.textColor = [NSColor whiteColor]; self.debuggerSideViewInput.textColor = [NSColor whiteColor];
self.debuggerSideViewInput.defaultParagraphStyle = paragraph_style; self.debuggerSideViewInput.defaultParagraphStyle = paragraph_style;

View File

@ -49,18 +49,12 @@
<view key="contentView" id="gIp-Ho-8D9"> <view key="contentView" id="gIp-Ho-8D9">
<rect key="frame" x="0.0" y="0.0" width="160" height="144"/> <rect key="frame" x="0.0" y="0.0" width="160" height="144"/>
<autoresizingMask key="autoresizingMask"/> <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> <subviews>
<view id="uqf-pe-VAF" customClass="GBView"> <view id="uqf-pe-VAF" customClass="GBView">
<rect key="frame" x="0.0" y="0.0" width="160" height="144"/> <rect key="frame" x="0.0" y="0.0" width="160" height="144"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
</view> </view>
</subviews> </subviews>
</customView>
</subviews>
</view> </view>
<connections> <connections>
<outlet property="delegate" destination="-2" id="jvM-lC-fKb"/> <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]; [self loadShader];
} }
- (void)addSubview:(NSView *)view
{
/* Fixes rounded corners */
[super addSubview:view];
[self setWantsLayer:YES];
}
- (void) loadShader - (void) loadShader
{ {
NSError *error = nil; NSError *error = nil;