mirror of https://github.com/aseprite/aseprite.git
Compare commits
3 Commits
e20e896428
...
de85332a9a
Author | SHA1 | Date |
---|---|---|
|
de85332a9a | |
|
41e5097c33 | |
|
5afa9e6b82 |
|
@ -1,5 +1,5 @@
|
|||
// Aseprite
|
||||
// Copyright (C) 2019-2024 Igara Studio S.A.
|
||||
// Copyright (C) 2019-2025 Igara Studio S.A.
|
||||
// Copyright (C) 2001-2018 David Capello
|
||||
//
|
||||
// This program is distributed under the terms of
|
||||
|
@ -104,7 +104,7 @@ void ColorPicker::pickColor(const Site& site,
|
|||
switch (mode) {
|
||||
// Pick from the composed image
|
||||
case FromComposition: {
|
||||
doc::RenderPlan plan(pref.experimental.composeGroups());
|
||||
doc::RenderPlan plan;
|
||||
plan.addLayer(sprite->root(), site.frame());
|
||||
|
||||
doc::CelList cels;
|
||||
|
|
|
@ -61,6 +61,7 @@
|
|||
#include "base/scoped_value.h"
|
||||
#include "doc/doc.h"
|
||||
#include "doc/mask_boundaries.h"
|
||||
#include "doc/render_plan.h"
|
||||
#include "doc/slice.h"
|
||||
#include "fmt/format.h"
|
||||
#include "os/color_space.h"
|
||||
|
@ -3097,13 +3098,16 @@ void Editor::updateAutoCelGuides(ui::Message* msg)
|
|||
// tool to show automatic guides.
|
||||
if (m_showAutoCelGuides && m_state->allowLayerEdges()) {
|
||||
auto mouseMsg = dynamic_cast<ui::MouseMessage*>(msg);
|
||||
|
||||
ColorPicker picker;
|
||||
picker.pickColor(getSite(),
|
||||
screenToEditorF(mouseMsg ? mouseMsg->position() : mousePosInDisplay()),
|
||||
m_proj,
|
||||
ColorPicker::FromComposition);
|
||||
m_showGuidesThisCel = (picker.layer() ? picker.layer()->cel(m_frame) : nullptr);
|
||||
doc::RenderPlan plan;
|
||||
Sprite* sprite = getSite().sprite();
|
||||
plan.addLayer(sprite->root(), getSite().frame());
|
||||
doc::CelList cels;
|
||||
sprite->pickCels(screenToEditorF(mouseMsg ? mouseMsg->position() : mousePosInDisplay()),
|
||||
1,
|
||||
plan,
|
||||
cels);
|
||||
m_showGuidesThisCel =
|
||||
((!cels.empty() && cels.front()->layer()) ? cels.front()->layer()->cel(m_frame) : nullptr);
|
||||
}
|
||||
else {
|
||||
m_showGuidesThisCel = nullptr;
|
||||
|
|
|
@ -60,6 +60,7 @@
|
|||
#include "doc/layer.h"
|
||||
#include "doc/layer_tilemap.h"
|
||||
#include "doc/mask.h"
|
||||
#include "doc/render_plan.h"
|
||||
#include "doc/slice.h"
|
||||
#include "doc/sprite.h"
|
||||
#include "fmt/format.h"
|
||||
|
@ -153,16 +154,15 @@ bool StandbyState::onMouseDown(Editor* editor, MouseMessage* msg)
|
|||
// Handle "Auto Select Layer"
|
||||
if (editor->isAutoSelectLayer()) {
|
||||
gfx::PointF cursor = editor->screenToEditorF(msg->position());
|
||||
ColorPicker picker;
|
||||
picker.pickColor(site, cursor, editor->projection(), ColorPicker::FromComposition);
|
||||
RenderPlan plan;
|
||||
plan.addLayer(site.sprite()->root(), site.frame());
|
||||
doc::CelList cels;
|
||||
site.sprite()->pickCels(cursor, 1, plan, cels);
|
||||
|
||||
const view::RealRange& range = context->range();
|
||||
if (picker.layer() && !range.contains(picker.layer())) {
|
||||
layer = picker.layer();
|
||||
if (layer) {
|
||||
editor->setLayer(layer);
|
||||
editor->flashCurrentLayer();
|
||||
}
|
||||
if (!cels.empty() && cels.front()->layer() && !range.contains(cels.front()->layer())) {
|
||||
editor->setLayer(cels.front()->layer());
|
||||
editor->flashCurrentLayer();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include "app/ui/workspace.h"
|
||||
#include "app/ui/workspace_tabs.h"
|
||||
#include "doc/sprite.h"
|
||||
#include "ui/manager.h"
|
||||
#include "ui/system.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
@ -120,6 +121,10 @@ void UIContext::setActiveView(DocView* docView)
|
|||
mainWin->getTimeline()->updateUsingEditor(editor);
|
||||
mainWin->getPreviewEditor()->updateUsingEditor(editor);
|
||||
|
||||
// Update mouse widgets immediately after changing views rather
|
||||
// than waiting for mouse movement.
|
||||
mainWin->manager()->_updateMouseWidgets();
|
||||
|
||||
// Change the image-type of color bar.
|
||||
ColorBar::instance()->setPixelFormat(app_get_current_pixel_format());
|
||||
|
||||
|
|
Loading…
Reference in New Issue