Fix inspector window rendering with device scaling

This commit is contained in:
Lawrence Lee 2021-05-02 15:50:55 -07:00
parent de9403f9fe
commit bce88478c4

View File

@ -485,9 +485,13 @@ bool Inspector::on_draw(const ::Cairo::RefPtr< Cairo::Context> &cr)
else {
// consider device scale and image scale
if (deviceScale > 1) {
#ifdef __APPLE__
// use full device resolution and let it scale the image (macOS)
cairo_surface_set_device_scale(cr->get_target()->cobj(), scale, scale);
scaledImage = false;
#else
cr->scale(1. / deviceScale, 1. / deviceScale);
#endif
}
int viewW = rtengine::min<int>(imW, ceil(availableSize.x + (topLeft.x - topLeftInt.x)));
int viewH = rtengine::min<int>(imH, ceil(availableSize.y + (topLeft.y - topLeftInt.y)));