Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 79cc7fe

Browse files
Merge pull request #5450 from livecodeian/bugfix-18939
[[ Bug 18939 ]] Draw player snapshot image at correct scale on hi-dpi displays.
2 parents 5fbaa96 + 7457024 commit 79cc7fe

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

docs/notes/bugfix-18939.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Fix player image incorrectly scaled in edit mode

engine/src/player-platform.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2355,8 +2355,14 @@ void MCPlayer::draw(MCDC *dc, const MCRectangle& p_dirty, bool p_isolated, bool
23552355
MCGImageCreateWithRaster(t_raster, t_image.image);
23562356
else
23572357
MCGImageCreateWithRasterNoCopy(t_raster, t_image.image);
2358+
23582359
if (t_image . image != nil)
2360+
{
2361+
// IM-2017-05-11: [[ Bug 18939 ]] Set x/y scales for image, which may be scaled.
2362+
t_image.x_scale = MCGFloat(MCGImageGetWidth(t_image.image)) / MCGFloat(trect.width);
2363+
t_image.y_scale = MCGFloat(MCGImageGetHeight(t_image.image)) / MCGFloat(trect.height);
23592364
dc -> drawimage(t_image, 0, 0, trect.width, trect.height, trect.x, trect.y);
2365+
}
23602366

23612367
MCGImageRelease(t_image.image);
23622368
MCPlatformUnlockPlayerBitmap(m_platform_player, t_bitmap);

0 commit comments

Comments
 (0)