// // KMMaskView.m // PDF Reader Pro Edition // // Created by zenghong on 6/20/23. // #import "KMMaskView.h" @implementation KMMaskView - (void)dealloc { } - (void)drawRect:(NSRect)dirtyRect { [super drawRect:dirtyRect]; self.wantsLayer = YES; self.layer.backgroundColor = [NSColor clearColor].CGColor; } - (instancetype)initWithFrame:(NSRect)frameRect { self = [super initWithFrame:frameRect]; if (self) { } return self; } #pragma mark - Mouse Event //重写是为了防止时间传递到父视图上去。具体的体现是隔着一个View还能操作window - (void)mouseDown:(NSEvent *)event { } - (void)mouseUp:(NSEvent *)event { } @end