summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Fl_cocoa.mm9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm
index 5d5596042..e2ddb8cc9 100644
--- a/src/Fl_cocoa.mm
+++ b/src/Fl_cocoa.mm
@@ -2277,9 +2277,14 @@ static FLTextInputContext* fltextinputcontext_instance = nil;
if (!through_Fl_X_flush) window->clear_damage();
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_14
if (gc) {
- if (aux_bitmap && CGBitmapContextGetBytesPerRow(gc) != CGBitmapContextGetBytesPerRow(aux_bitmap)) [self reset_aux_bitmap];
if (!aux_bitmap) [self create_aux_bitmap:gc retina:d->mapped_to_retina()];
- memcpy(CGBitmapContextGetData(aux_bitmap), CGBitmapContextGetData(gc), CGBitmapContextGetHeight(gc) * CGBitmapContextGetBytesPerRow(gc));
+ if (CGBitmapContextGetBytesPerRow(gc) != CGBitmapContextGetBytesPerRow(aux_bitmap)) {
+ CGImageRef img = CGBitmapContextCreateImage(gc);
+ CGContextDrawImage(aux_bitmap, [self frame], img);
+ CGImageRelease(img);
+ } else {
+ memcpy(CGBitmapContextGetData(aux_bitmap), CGBitmapContextGetData(gc), CGBitmapContextGetHeight(gc) * CGBitmapContextGetBytesPerRow(gc));
+ }
Fl_Cocoa_Window_Driver::q_release_context();
direct_draw = NO;
}