summaryrefslogtreecommitdiff
path: root/platform/macos/src/NSImage+MGLAdditions.mm
diff options
context:
space:
mode:
Diffstat (limited to 'platform/macos/src/NSImage+MGLAdditions.mm')
-rw-r--r--platform/macos/src/NSImage+MGLAdditions.mm4
1 files changed, 3 insertions, 1 deletions
diff --git a/platform/macos/src/NSImage+MGLAdditions.mm b/platform/macos/src/NSImage+MGLAdditions.mm
index 6bb8fca68b..ecd8aabe15 100644
--- a/platform/macos/src/NSImage+MGLAdditions.mm
+++ b/platform/macos/src/NSImage+MGLAdditions.mm
@@ -23,7 +23,9 @@
NSBitmapImageRep *rep = [[NSBitmapImageRep alloc] initWithCGImage:image];
CGImageRelease(image);
- if (self = [self initWithSize:NSMakeSize(styleImage->getWidth(), styleImage->getHeight())]) {
+ CGFloat w = styleImage->getImage().size.width / styleImage->getPixelRatio();
+ CGFloat h = styleImage->getImage().size.height / styleImage->getPixelRatio();
+ if (self = [self initWithSize:NSMakeSize(w, h)]) {
[self addRepresentation:rep];
[self setTemplate:styleImage->isSdf()];
}