summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2019-08-19 09:34:42 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2019-08-19 09:34:42 +0200
commite16eea32be0cd0a22d9e5d9c334cd93f759d923e (patch)
tree5507d5101b018d0f912db5e2cd44104930ef2128 /src
parent8c39007b265d978ed16adc06b7b1f56c508f7f51 (diff)
Avoid repetition of the same multiplication.
Diffstat (limited to 'src')
-rw-r--r--src/Fl_cocoa.mm4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm
index 452a3a3be..c99d73aab 100644
--- a/src/Fl_cocoa.mm
+++ b/src/Fl_cocoa.mm
@@ -4208,8 +4208,8 @@ static NSBitmapImageRep* rect_to_NSBitmapImageRep_layer(Fl_Window *win, int x, i
BOOL need_subimage = x || y || w != win->w() || h != win->h();
if (need_subimage) {
float s = Fl::screen_driver()->scale(0);
- int resolution = Fl_Cocoa_Window_Driver::driver(win->top_window())->mapped_to_retina() ? 2 : 1;
- CGRect rect = CGRectMake(x * s * resolution, y * s * resolution, w * s * resolution, h * s * resolution);
+ if (Fl_Cocoa_Window_Driver::driver(win)->mapped_to_retina()) s *= 2;
+ CGRect rect = CGRectMake(x * s, y * s, w * s, h * s);
cgimg = CGImageCreateWithImageInRect(cgimg, rect);
}
bitmap = [[NSBitmapImageRep alloc] initWithCGImage:cgimg];//10.5