Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on Undo Transaction that contains ReplaceColor after SpriteSize #2108

Closed
theTreadlight opened this issue Jul 13, 2019 · 0 comments

Comments

@theTreadlight
Copy link

commented Jul 13, 2019

Okay……this is really specific, so I'll start with the sample script.  The comments describe what this is doing.

-- Creates a sprite with two concentric rectangles of different colors, changes the size, and replaces the outer color.
-- This will cause Aseprite to crash if you undo twice.
local spr = Sprite(8,8);
local brsh = Brush{size=1};
app.fgColor = Color(0xFFFF00FF);
app.bgColor = Color(0xFFFFFF00);
app.useTool{tool="filled_rectangle",color=app.fgColor,brush=brsh,points={Point(0,0),Point(7,7)}};
app.useTool{tool="filled_rectangle",color=app.bgColor,brush=brsh,points={Point(2,2),Point(5,5)}};
app.bgColor = Color(0x00000000);

-- All of that outside of the transaction to isolate the problem.
app.transaction(
	function()
		app.command.SpriteSize();
		app.command.ReplaceColor();
	end);

app.undo();
-- It doesn't crash immediately if you have non-mask colors present that aren't replaced.
-- Instead, it moves the whole image down & right.

-- However, it will crash if you undo again.
--app.undo();

I don't know how to bypass the dialogs from AppCommands in a script, so the most I could do was make it work if you mash enter.
What baffles me here is that it moves the image instead of crashing if the color you replaced wasn't the only color in the sprite, though still crashing if you undo again.


Aseprite and System version

  • Aseprite version: v1.2.13-x64 installer
  • System: Win7 SP1 x86_64

@dacap dacap self-assigned this Jul 15, 2019

@dacap dacap added this to the v1.x-bugs milestone Jul 15, 2019

@dacap dacap closed this in 655ce92 Jul 15, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.