From 76ef344f49f1b72fe167bb0c1cb8da09c2dc8aa9 Mon Sep 17 00:00:00 2001 From: David Capello Date: Sat, 28 Mar 2020 12:50:01 -0300 Subject: [PATCH] [lua] Support to use Image:drawSprite(sprite) without frame to render the first frame --- src/app/script/frame_class.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/script/frame_class.cpp b/src/app/script/frame_class.cpp index 850eb77a6..ae0684f13 100644 --- a/src/app/script/frame_class.cpp +++ b/src/app/script/frame_class.cpp @@ -1,5 +1,5 @@ // Aseprite -// Copyright (C) 2018 Igara Studio S.A. +// Copyright (C) 2018-2020 Igara Studio S.A. // Copyright (C) 2018 David Capello // // This program is distributed under the terms of @@ -146,6 +146,8 @@ doc::frame_t get_frame_number_from_arg(lua_State* L, int index) auto obj = may_get_obj(L, index); if (obj) return obj->frame; + else if (lua_isnil(L, index) || lua_isnone(L, index)) + return 0; else return lua_tointeger(L, index)-1; }