Skip to content

Commit

Permalink
Editor: do not resize button if "new" Image value is the same as old
Browse files Browse the repository at this point in the history
This prevents buttons resizing to the image's size in case user calls Sprite Selector dialog and cancels it.
This helps if button was previously resized manually after assigning a image.
  • Loading branch information
ivan-mogilko committed Jan 15, 2025
1 parent f5c852d commit 728d89a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Editor/AGS.Editor/Panes/GUIEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ protected override void OnPropertyChanged(string propertyName, object oldValue)
if ((_selectedControl != null) && (_selectedControl is GUIButton))
{
GUIButton selectedButton = (GUIButton)_selectedControl;
if (selectedButton.Image > 0)
if (selectedButton.Image > 0 && (selectedButton.Image != (int)oldValue))
{
int newWidth, newHeight;
Utilities.GetSizeSpriteWillBeRenderedInGame(selectedButton.Image, out newWidth, out newHeight);
Expand Down

0 comments on commit 728d89a

Please sign in to comment.