mirror of
https://github.com/aseprite/aseprite.git
synced 2025-02-06 12:39:57 +00:00
Don't use last selected document as active document if UI is enabled
Related to bug found in #656. In this way, if the UI is enabled, the active document is != null only if there is an active view for it. Anyway, in batch mode we can potentially have a lot of bugs. There are several UI commands that think that active view != null (and current_editor != null) when the active document != null.
This commit is contained in:
parent
4f33bef43c
commit
ae03dd5461
@ -199,11 +199,13 @@ void UIContext::onGetActiveSite(Site* site) const
|
||||
view->getSite(site);
|
||||
}
|
||||
// Default/dummy site (maybe for batch/command line mode)
|
||||
else if (Document* doc = m_lastSelectedDoc) {
|
||||
site->document(doc);
|
||||
site->sprite(doc->sprite());
|
||||
site->layer(doc->sprite()->indexToLayer(LayerIndex(0)));
|
||||
site->frame(0);
|
||||
else if (!isUiAvailable()) {
|
||||
if (Document* doc = m_lastSelectedDoc) {
|
||||
site->document(doc);
|
||||
site->sprite(doc->sprite());
|
||||
site->layer(doc->sprite()->indexToLayer(LayerIndex(0)));
|
||||
site->frame(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user