Compare commits

...

3 Commits

Author SHA1 Message Date
Gaspar Capello 0d07a6c928
Merge 5afa9e6b82 into 107e846911 2025-10-02 11:11:28 +02:00
David Capello 107e846911 Remove direct TRACEARGS() calls
build / build (Debug, macos-latest, lua, cli) (push) Has been cancelled Details
build / build (Debug, macos-latest, noscripts, cli) (push) Has been cancelled Details
build / build (Debug, ubuntu-latest, lua, cli) (push) Has been cancelled Details
build / build (Debug, ubuntu-latest, noscripts, cli) (push) Has been cancelled Details
build / build (Debug, windows-latest, lua, cli) (push) Has been cancelled Details
build / build (Debug, windows-latest, noscripts, cli) (push) Has been cancelled Details
build / build (RelWithDebInfo, macos-latest, lua, gui) (push) Has been cancelled Details
build / build (RelWithDebInfo, ubuntu-latest, lua, gui) (push) Has been cancelled Details
build / build (RelWithDebInfo, windows-latest, lua, gui) (push) Has been cancelled Details
2025-10-01 16:53:07 -03:00
Gaspar Capello 5afa9e6b82 Improper use of pickColor to get the top layer
PickColor was replaced by pickCels in some places in the code because
only the top layer was required; the color was ignored.
Additionally, the RenderPlan for those pickColors (and now pickCels)
was incorrectly initialized for the AutoSelect Layer. Now is fixed.
2025-09-26 17:28:19 -03:00
6 changed files with 24 additions and 25 deletions

View File

@ -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;

View File

@ -34,7 +34,6 @@ namespace app { namespace script {
template<>
void push_value_to_lua(lua_State* L, const std::nullptr_t&)
{
TRACEARGS("push_value_to_lua nullptr_t");
lua_pushnil(L);
}

View File

@ -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;

View File

@ -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();
}
}

View File

@ -1,5 +1,5 @@
// Aseprite
// Copyright (C) 2019-2023 Igara Studio S.A.
// Copyright (C) 2019-2025 Igara Studio S.A.
//
// This program is distributed under the terms of
// the End-User License Agreement for Aseprite.
@ -50,10 +50,8 @@ TaskWidget::TaskWidget(const Type type, base::task::func_t&& func)
}
else if (m_progressBar.parent()) {
float v = m_task.progress();
if (v > 0.0f) {
TRACEARGS("progressBar setValue", int(std::clamp(v * 100.0f, 0.0f, 100.0f)));
if (v > 0.0f)
m_progressBar.setValue(int(std::clamp(v * 100.0f, 0.0f, 100.0f)));
}
}
});
m_monitorTimer.start();

View File

@ -1,5 +1,5 @@
// Aseprite Steam Wrapper
// Copyright (c) 2020-2024 Igara Studio S.A.
// Copyright (c) 2020-2025 Igara Studio S.A.
// Copyright (c) 2016 David Capello
//
// This file is released under the terms of the MIT license.
@ -153,8 +153,6 @@ public:
CallbackMsg_t msg;
if (SteamAPI_ManualDispatch_GetNextCallback(m_pipe, &msg)) {
// TRACEARGS("SteamAPI_ManualDispatch_GetNextCallback", msg.callback);
bool disconnected = false;
switch (msg.callback) {
case kSteamServersDisconnected: