Merge pull request #12943 from nbvdkamp/fix-zero-area-skin-element-scale-crash

Prevent skin editor crash when scaling 0 area drawables
This commit is contained in:
Dan Balasescu 2021-05-26 16:37:58 +09:00 committed by GitHub
commit 34d1d5198f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -59,6 +59,10 @@ namespace osu.Game.Skinning.Editor
// the selection quad is always upright, so use an AABB rect to make mutating the values easier.
var selectionRect = getSelectionQuad().AABBFloat;
// If the selection has no area we cannot scale it
if (selectionRect.Area == 0)
return false;
// copy to mutate, as we will need to compare to the original later on.
var adjustedRect = selectionRect;