mirror of
https://github.com/aseprite/aseprite.git
synced 2025-02-06 12:39:57 +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
|
// Aseprite
|
||||||
// Copyright (C) 2019-2024 Igara Studio S.A.
|
// Copyright (C) 2019-2023 Igara Studio S.A.
|
||||||
// Copyright (C) 2001-2018 David Capello
|
// Copyright (C) 2001-2018 David Capello
|
||||||
//
|
//
|
||||||
// This program is distributed under the terms of
|
// This program is distributed under the terms of
|
||||||
@ -44,6 +44,7 @@
|
|||||||
#include "doc/mask.h"
|
#include "doc/mask.h"
|
||||||
#include "doc/sprite.h"
|
#include "doc/sprite.h"
|
||||||
#include "gfx/region.h"
|
#include "gfx/region.h"
|
||||||
|
#include "render/render.h"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
@ -1065,8 +1066,10 @@ void PixelsMovement::drawImage(
|
|||||||
|
|
||||||
if (renderOriginalLayer) {
|
if (renderOriginalLayer) {
|
||||||
render::Render render;
|
render::Render render;
|
||||||
renderLayer(&render, dst, m_site.layer(), m_site.frame(),
|
render.renderLayer(
|
||||||
gfx::Clip(bounds.x-pt.x, bounds.y-pt.y, bounds));
|
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;
|
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
|
// TODO This case is used in paste too, where the cel() can be
|
||||||
// nullptr (e.g. we paste the clipboard image into an empty
|
// nullptr (e.g. we paste the clipboard image into an empty
|
||||||
// cel).
|
// cel).
|
||||||
// Note: m_site.layer()->canEditPixels() is not used since
|
|
||||||
// PixelsMovement can modify hidden layers.
|
|
||||||
if (m_site.layer() &&
|
if (m_site.layer() &&
|
||||||
m_site.layer()->isEditable() &&
|
m_site.layer()->canEditPixels()) {
|
||||||
!m_site.layer()->isReference()) {
|
|
||||||
cels.push_back(m_site.cel());
|
cels.push_back(m_site.cel());
|
||||||
}
|
}
|
||||||
return cels;
|
return cels;
|
||||||
@ -1320,8 +1320,7 @@ CelList PixelsMovement::getEditableCels()
|
|||||||
// Current cel (m_site.cel()) can be nullptr when we paste in an
|
// Current cel (m_site.cel()) can be nullptr when we paste in an
|
||||||
// empty cel (Ctrl+V) and cut (Ctrl+X) the floating pixels.
|
// empty cel (Ctrl+V) and cut (Ctrl+X) the floating pixels.
|
||||||
if (m_site.cel() &&
|
if (m_site.cel() &&
|
||||||
m_site.cel()->layer()->isEditable() &&
|
m_site.cel()->layer()->canEditPixels()) {
|
||||||
!m_site.cel()->layer()->isReference()) {
|
|
||||||
CelList::iterator it;
|
CelList::iterator it;
|
||||||
|
|
||||||
// If we are in a linked cel, remove the cel that matches the
|
// If we are in a linked cel, remove the cel that matches the
|
||||||
@ -1441,25 +1440,6 @@ void PixelsMovement::reproduceAllTransformationsWithInnerCmds()
|
|||||||
updateDocumentMask();
|
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
|
#if _DEBUG
|
||||||
void PixelsMovement::dumpInnerCmds()
|
void PixelsMovement::dumpInnerCmds()
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
// Aseprite
|
// Aseprite
|
||||||
// Copyright (C) 2019-2024 Igara Studio S.A.
|
// Copyright (C) 2019-2021 Igara Studio S.A.
|
||||||
// Copyright (C) 2001-2018 David Capello
|
// Copyright (C) 2001-2018 David Capello
|
||||||
//
|
//
|
||||||
// This program is distributed under the terms of
|
// This program is distributed under the terms of
|
||||||
@ -20,7 +20,6 @@
|
|||||||
#include "doc/image_ref.h"
|
#include "doc/image_ref.h"
|
||||||
#include "gfx/size.h"
|
#include "gfx/size.h"
|
||||||
#include "obs/connection.h"
|
#include "obs/connection.h"
|
||||||
#include "render/render.h"
|
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
@ -160,11 +159,6 @@ namespace app {
|
|||||||
const double angle);
|
const double angle);
|
||||||
CelList getEditableCels();
|
CelList getEditableCels();
|
||||||
void reproduceAllTransformationsWithInnerCmds();
|
void reproduceAllTransformationsWithInnerCmds();
|
||||||
void renderLayer(render::Render* render,
|
|
||||||
Image* dstImage,
|
|
||||||
const Layer* layer,
|
|
||||||
frame_t frame,
|
|
||||||
const gfx::Clip& area);
|
|
||||||
#if _DEBUG
|
#if _DEBUG
|
||||||
void dumpInnerCmds();
|
void dumpInnerCmds();
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user