mirror of
https://github.com/ppy/osu
synced 2025-01-09 15:49:32 +00:00
Prevent skin editor crash when scaling 0 area drawables
Some skinnable drawables can have 0 width or height in certain cases, leading to division by 0 and a crash when the position is updated.
This commit is contained in:
parent
6263ebf9da
commit
65649e5a62
@ -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.0)
|
||||
return false;
|
||||
|
||||
// copy to mutate, as we will need to compare to the original later on.
|
||||
var adjustedRect = selectionRect;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user