Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Set compositing mode to sourceover when doing advanced char drawing s…

…o emoji's don't draw transparent backgrounds through the window
  • Loading branch information...
commit f67bed74e119e723e12247cdf437961d7fbb18f2 1 parent 479a0a9
authored August 09, 2012

Showing 1 changed file with 4 additions and 0 deletions. Show diff stats Hide diff stats

  1. 4  PTYTextView.m
4  PTYTextView.m
@@ -6077,6 +6077,9 @@ - (void)_advancedDrawChar:(unichar*)codes
6077 6077
                  color, NSForegroundColorAttributeName,
6078 6078
                  nil];
6079 6079
     }
  6080
+    NSGraphicsContext *ctx = [NSGraphicsContext currentContext];
  6081
+    [ctx saveGraphicsState];
  6082
+    [ctx setCompositingOperation:NSCompositeSourceOver];
6080 6083
     NSMutableAttributedString* attributedString = [[[NSMutableAttributedString alloc] initWithString:str
6081 6084
                                                                                           attributes:attrs] autorelease];
6082 6085
     // Note that drawInRect doesn't use the right baseline, but drawWithRect
@@ -6109,6 +6112,7 @@ - (void)_advancedDrawChar:(unichar*)codes
6109 6112
                                                   lineHeight)
6110 6113
                                options:0];  // NSStringDrawingUsesLineFragmentOrigin
6111 6114
     }
  6115
+    [ctx restoreGraphicsState];
6112 6116
 }
6113 6117
 
6114 6118
 - (void)_drawComplexCharRun:(CharRun *)currentRun

0 notes on commit f67bed7

Please sign in to comment.
Something went wrong with that request. Please try again.