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

@ -50,16 +50,10 @@
<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> <subviews>
<customView id="KTk-4M-J7t" customClass="GBBorderView"> <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"/>
<subviews> </view>
<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> </subviews>
</view> </view>
<connections> <connections>

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;