mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-30 15:32:38 +00:00
lua: Add support for app.preferences.document(nil) to get default preferences for new documents
This commit is contained in:
parent
1584cc59ac
commit
f53ecab282
@ -89,10 +89,10 @@ int ToolPref_function(lua_State* L)
|
||||
|
||||
int DocPref_function(lua_State* L)
|
||||
{
|
||||
auto sprite = get_docobj<Sprite>(L, 1);
|
||||
auto sprite = may_get_docobj<Sprite>(L, 1);
|
||||
DocumentPreferences& docPref =
|
||||
Preferences::instance().document(
|
||||
static_cast<const Doc*>(sprite->document()));
|
||||
sprite ? static_cast<const Doc*>(sprite->document()): nullptr);
|
||||
push_ptr(L, (Section*)&docPref);
|
||||
return 1;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user