Compare commits

...

3 Commits

Author SHA1 Message Date
Gaspar Capello 3448bd36e3
Merge 5ddd14106b into 41e5097c33 2025-09-29 18:09:15 -03:00
Joshua Lopez 41e5097c33 Fix mouse gestures not working after switching tabs (fix aseprite#4388)
build / build (Debug, macos-latest, lua, cli) (push) Waiting to run Details
build / build (Debug, macos-latest, noscripts, cli) (push) Waiting to run Details
build / build (Debug, ubuntu-latest, lua, cli) (push) Waiting to run Details
build / build (Debug, ubuntu-latest, noscripts, cli) (push) Waiting to run Details
build / build (Debug, windows-latest, lua, cli) (push) Waiting to run Details
build / build (Debug, windows-latest, noscripts, cli) (push) Waiting to run Details
build / build (RelWithDebInfo, macos-latest, lua, gui) (push) Waiting to run Details
build / build (RelWithDebInfo, ubuntu-latest, lua, gui) (push) Waiting to run Details
build / build (RelWithDebInfo, windows-latest, lua, gui) (push) Waiting to run Details
2025-09-29 18:06:45 -03:00
Gaspar Capello 5ddd14106b Fix move tool with Auto Select Layer isn't working (fix #4812)
Prior to this fix, automatic layer selection for the Move Tool
did not work when the "Compose Groups Separately" option was active.
2025-09-26 15:47:53 -03:00
5 changed files with 20 additions and 12 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
@ -108,7 +108,7 @@ void ColorPicker::pickColor(const Site& site,
plan.addLayer(sprite->root(), site.frame());
doc::CelList cels;
sprite->pickCels(pos, kOpacityThreshold, plan, cels);
sprite->pickCels(pos, plan, cels, kOpacityThreshold);
if (!cels.empty())
m_layer = cels.front()->layer();
@ -181,7 +181,7 @@ void ColorPicker::pickColor(const Site& site,
plan.addLayer(refLayer, site.frame());
doc::CelList cels;
sprite->pickCels(pos, kOpacityThreshold, plan, cels);
sprite->pickCels(pos, plan, cels, kOpacityThreshold);
for (const Cel* cel : cels) {
doc::color_t imageColor;

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,12 +154,14 @@ 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);
doc::RenderPlan plan;
plan.addLayer(site.sprite()->root(), site.frame());
doc::CelList cels;
site.sprite()->pickCels(cursor, plan, cels);
const view::RealRange& range = context->range();
if (picker.layer() && !range.contains(picker.layer())) {
layer = picker.layer();
if (!cels.empty() && !range.contains(cels.front()->layer())) {
layer = cels.front()->layer();
if (layer) {
editor->setLayer(layer);
editor->flashCurrentLayer();

View File

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

View File

@ -1,5 +1,5 @@
// Aseprite Document Library
// Copyright (C) 2018-2024 Igara Studio S.A.
// Copyright (C) 2018-2025 Igara Studio S.A.
// Copyright (C) 2001-2018 David Capello
//
// This file is released under the terms of the MIT license.
@ -656,9 +656,9 @@ void Sprite::remapTilemaps(const Tileset* tileset, const Remap& remap)
// Drawing
void Sprite::pickCels(const gfx::PointF& pos,
const int opacityThreshold,
const RenderPlan& plan,
CelList& cels) const
CelList& cels,
const int opacityThreshold) const
{
// Iterate cels in reversed order (from the front-most to the
// bottom-most) so we pick first visible cel in the given position.

View File

@ -212,9 +212,9 @@ public:
void remapImages(const Remap& remap);
void remapTilemaps(const Tileset* tileset, const Remap& remap);
void pickCels(const gfx::PointF& pos,
const int opacityThreshold,
const RenderPlan& plan,
CelList& cels) const;
CelList& cels,
const int opacityThreshold = 1) const;
////////////////////////////////////////
// Iterators