mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-30 15:32:38 +00:00
Revert "Drop selection if we hide the layer (fix #4179)"
This reverts commit 078dac28d7064b00e6a167f11b71b43e8012005c.
This commit is contained in:
parent
f22603caea
commit
5dbaa295c5
@ -1,5 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2019-2024 Igara Studio S.A.
|
||||
// Copyright (C) 2019-2023 Igara Studio S.A.
|
||||
// Copyright (C) 2001-2018 David Capello
|
||||
//
|
||||
// This program is distributed under the terms of
|
||||
@ -44,6 +44,7 @@
|
||||
#include "doc/mask.h"
|
||||
#include "doc/sprite.h"
|
||||
#include "gfx/region.h"
|
||||
#include "render/render.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
@ -1065,8 +1066,10 @@ void PixelsMovement::drawImage(
|
||||
|
||||
if (renderOriginalLayer) {
|
||||
render::Render render;
|
||||
renderLayer(&render, dst, m_site.layer(), m_site.frame(),
|
||||
gfx::Clip(bounds.x-pt.x, bounds.y-pt.y, bounds));
|
||||
render.renderLayer(
|
||||
dst, m_site.layer(), m_site.frame(),
|
||||
gfx::Clip(bounds.x-pt.x, bounds.y-pt.y, bounds),
|
||||
BlendMode::SRC);
|
||||
}
|
||||
|
||||
color_t maskColor = m_maskColor;
|
||||
@ -1307,11 +1310,8 @@ CelList PixelsMovement::getEditableCels()
|
||||
// TODO This case is used in paste too, where the cel() can be
|
||||
// nullptr (e.g. we paste the clipboard image into an empty
|
||||
// cel).
|
||||
// Note: m_site.layer()->canEditPixels() is not used since
|
||||
// PixelsMovement can modify hidden layers.
|
||||
if (m_site.layer() &&
|
||||
m_site.layer()->isEditable() &&
|
||||
!m_site.layer()->isReference()) {
|
||||
m_site.layer()->canEditPixels()) {
|
||||
cels.push_back(m_site.cel());
|
||||
}
|
||||
return cels;
|
||||
@ -1320,8 +1320,7 @@ CelList PixelsMovement::getEditableCels()
|
||||
// Current cel (m_site.cel()) can be nullptr when we paste in an
|
||||
// empty cel (Ctrl+V) and cut (Ctrl+X) the floating pixels.
|
||||
if (m_site.cel() &&
|
||||
m_site.cel()->layer()->isEditable() &&
|
||||
!m_site.cel()->layer()->isReference()) {
|
||||
m_site.cel()->layer()->canEditPixels()) {
|
||||
CelList::iterator it;
|
||||
|
||||
// If we are in a linked cel, remove the cel that matches the
|
||||
@ -1441,25 +1440,6 @@ void PixelsMovement::reproduceAllTransformationsWithInnerCmds()
|
||||
updateDocumentMask();
|
||||
}
|
||||
|
||||
void PixelsMovement::renderLayer(
|
||||
render::Render* render,
|
||||
Image* dstImage,
|
||||
const Layer* layer,
|
||||
frame_t frame,
|
||||
const gfx::Clip& area)
|
||||
{
|
||||
// On PixelsMovement is posible to modify the pixels on
|
||||
// the current layer, to do so we need to include the layer
|
||||
// on the renderPlan (inside renderLayer), which only includes
|
||||
// visible layers, that is why we turn ON the layer visibility
|
||||
// temporarily.
|
||||
const bool layerIsVisible = m_site.layer()->isVisible();
|
||||
m_site.layer()->setVisible(true);
|
||||
render->renderLayer(dstImage, layer, frame, area, BlendMode::SRC);
|
||||
if (!layerIsVisible)
|
||||
m_site.layer()->setVisible(false);
|
||||
}
|
||||
|
||||
#if _DEBUG
|
||||
void PixelsMovement::dumpInnerCmds()
|
||||
{
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2019-2024 Igara Studio S.A.
|
||||
// Copyright (C) 2019-2021 Igara Studio S.A.
|
||||
// Copyright (C) 2001-2018 David Capello
|
||||
//
|
||||
// This program is distributed under the terms of
|
||||
@ -20,7 +20,6 @@
|
||||
#include "doc/image_ref.h"
|
||||
#include "gfx/size.h"
|
||||
#include "obs/connection.h"
|
||||
#include "render/render.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
@ -160,11 +159,6 @@ namespace app {
|
||||
const double angle);
|
||||
CelList getEditableCels();
|
||||
void reproduceAllTransformationsWithInnerCmds();
|
||||
void renderLayer(render::Render* render,
|
||||
Image* dstImage,
|
||||
const Layer* layer,
|
||||
frame_t frame,
|
||||
const gfx::Clip& area);
|
||||
#if _DEBUG
|
||||
void dumpInnerCmds();
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user