comparison mac/dw.m @ 1948:bbb1fb54f321

Mac: Need to retain the cached render bitmap and recreate it on resize on 10.14.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sat, 06 Jul 2019 18:44:25 +0000
parents 3aef9be654ce
children c71e5da5b801
comparison
equal deleted inserted replaced
1947:3aef9be654ce 1948:bbb1fb54f321
860 @implementation DWRender 860 @implementation DWRender
861 -(void *)userdata { return userdata; } 861 -(void *)userdata { return userdata; }
862 -(void)setUserdata:(void *)input { userdata = input; } 862 -(void)setUserdata:(void *)input { userdata = input; }
863 -(void)setFont:(NSFont *)input { [font release]; font = input; [font retain]; } 863 -(void)setFont:(NSFont *)input { [font release]; font = input; [font retain]; }
864 -(NSFont *)font { return font; } 864 -(NSFont *)font { return font; }
865 -(void)setSize:(NSSize)input { size = input; } 865 -(void)setSize:(NSSize)input {
866 size = input;
867 if(cachedDrawingRep)
868 {
869 NSBitmapImageRep *oldrep = cachedDrawingRep;
870 cachedDrawingRep = [self bitmapImageRepForCachingDisplayInRect:self.bounds];
871 [cachedDrawingRep retain];
872 [oldrep release];
873 }
874 }
866 -(NSSize)size { return size; } 875 -(NSSize)size { return size; }
867 #ifdef BUILDING_FOR_MOJAVE 876 #ifdef BUILDING_FOR_MOJAVE
868 -(NSBitmapImageRep *)cachedDrawingRep { 877 -(NSBitmapImageRep *)cachedDrawingRep {
869 if(!cachedDrawingRep) 878 if(!cachedDrawingRep)
879 {
870 cachedDrawingRep = [self bitmapImageRepForCachingDisplayInRect:self.bounds]; 880 cachedDrawingRep = [self bitmapImageRepForCachingDisplayInRect:self.bounds];
881 [cachedDrawingRep retain];
882 }
871 return cachedDrawingRep; 883 return cachedDrawingRep;
872 } 884 }
873 #endif 885 #endif
874 -(void)mouseDown:(NSEvent *)theEvent 886 -(void)mouseDown:(NSEvent *)theEvent
875 { 887 {