Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/notes/bugfix-18939.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Fix player image incorrectly scaled in edit mode
6 changes: 6 additions & 0 deletions engine/src/player-platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2355,8 +2355,14 @@ void MCPlayer::draw(MCDC *dc, const MCRectangle& p_dirty, bool p_isolated, bool
MCGImageCreateWithRaster(t_raster, t_image.image);
else
MCGImageCreateWithRasterNoCopy(t_raster, t_image.image);

if (t_image . image != nil)
{
// IM-2017-05-11: [[ Bug 18939 ]] Set x/y scales for image, which may be scaled.
t_image.x_scale = MCGFloat(MCGImageGetWidth(t_image.image)) / MCGFloat(trect.width);
t_image.y_scale = MCGFloat(MCGImageGetHeight(t_image.image)) / MCGFloat(trect.height);
dc -> drawimage(t_image, 0, 0, trect.width, trect.height, trect.x, trect.y);
}

MCGImageRelease(t_image.image);
MCPlatformUnlockPlayerBitmap(m_platform_player, t_bitmap);
Expand Down