mirror of
https://github.com/aseprite/aseprite.git
synced 2025-04-16 23:42:57 +00:00
Pick the new tiles after moving/copying them in the tileset
This commit is contained in:
parent
a9974e37d3
commit
6b43f7ca05
@ -67,6 +67,8 @@ protected:
|
||||
move_tiles_in_tileset(tx, tileset, picks, currentEntry, beforeIndex);
|
||||
|
||||
tx.commit();
|
||||
|
||||
ctx->setSelectedTiles(picks);
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -397,11 +397,6 @@ doc::tile_index ColorBar::getBgTile() const
|
||||
return m_bgColor.getColor().getIndex(); // TODO
|
||||
}
|
||||
|
||||
PaletteView* ColorBar::getPaletteView()
|
||||
{
|
||||
return &m_paletteView;
|
||||
}
|
||||
|
||||
ColorBar::ColorSelector ColorBar::getColorSelector() const
|
||||
{
|
||||
return m_selector;
|
||||
@ -1032,7 +1027,8 @@ void ColorBar::onTilesViewDragAndDrop(doc::Tileset* tileset,
|
||||
showRemapTiles();
|
||||
|
||||
try {
|
||||
ContextWriter writer(UIContext::instance(), 500);
|
||||
Context* ctx = UIContext::instance();
|
||||
ContextWriter writer(ctx, 500);
|
||||
Tx tx(writer.context(), Strings::color_bar_drag_and_drop_tiles(), ModifyDocument);
|
||||
if (isCopy)
|
||||
copy_tiles_in_tileset(tx, tileset, picks, currentEntry, beforeIndex);
|
||||
@ -1042,6 +1038,8 @@ void ColorBar::onTilesViewDragAndDrop(doc::Tileset* tileset,
|
||||
|
||||
m_scrollableTilesView.updateView();
|
||||
update_screen_for_document(writer.document());
|
||||
|
||||
ctx->setSelectedTiles(picks);
|
||||
}
|
||||
catch (base::Exception& e) {
|
||||
Console::showException(e);
|
||||
|
@ -75,7 +75,8 @@ namespace app {
|
||||
doc::tile_index getFgTile() const;
|
||||
doc::tile_index getBgTile() const;
|
||||
|
||||
PaletteView* getPaletteView();
|
||||
PaletteView* getPaletteView() { return &m_paletteView; }
|
||||
PaletteView* getTilesView() { return &m_tilesView; }
|
||||
|
||||
ColorSelector getColorSelector() const;
|
||||
void setColorSelector(ColorSelector selector);
|
||||
|
@ -191,6 +191,16 @@ void UIContext::onSetSelectedColors(const doc::PalettePicks& picks)
|
||||
Context::onSetSelectedColors(picks);
|
||||
}
|
||||
|
||||
void UIContext::onSetSelectedTiles(const doc::PalettePicks& picks)
|
||||
{
|
||||
if (activeView()) {
|
||||
if (ColorBar* colorBar = ColorBar::instance())
|
||||
colorBar->getTilesView()->setSelectedEntries(picks);
|
||||
}
|
||||
else if (!isUIAvailable())
|
||||
Context::onSetSelectedTiles(picks);
|
||||
}
|
||||
|
||||
DocView* UIContext::getFirstDocView(Doc* document) const
|
||||
{
|
||||
Workspace* workspace = App::instance()->workspace();
|
||||
|
@ -58,6 +58,7 @@ namespace app {
|
||||
void onSetActiveFrame(const doc::frame_t frame) override;
|
||||
void onSetRange(const DocRange& range) override;
|
||||
void onSetSelectedColors(const doc::PalettePicks& picks) override;
|
||||
void onSetSelectedTiles(const doc::PalettePicks& picks) override;
|
||||
void onCloseDocument(Doc* doc) override;
|
||||
|
||||
private:
|
||||
|
Loading…
x
Reference in New Issue
Block a user