Files
flameshot/src/widgets/capture/modificationcommand.cpp
Boyuan Yang a9c7cc7b04 Use SPDX-License-Identifier
closes: #1374 .

Use SPDX short-form identifiers instead of lengthy copyright
header to document per-file license and copyright.

This commit updates all files under src/ directory where applicable
as well as org.flameshot.Flameshot.metainfo.xml.
2021-02-20 19:22:53 -05:00

29 lines
679 B
C++

// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: 2017-2019 Alejandro Sirgo Rica & Contributors
#include "modificationcommand.h"
#include <QPainter>
ModificationCommand::ModificationCommand(QPixmap* p, CaptureTool* t)
: m_pixmap(p)
, m_tool(t)
{
setText(t->name());
}
void ModificationCommand::undo()
{
m_tool->undo(*m_pixmap);
}
void ModificationCommand::redo()
{
QPainter p(m_pixmap);
p.setRenderHint(QPainter::Antialiasing);
m_tool->process(p, *m_pixmap, true);
if (m_tool->nameID() == ToolType::CIRCLECOUNT) {
emit this->m_tool->requestAction(
CaptureTool::Request::REQ_INCREMENT_CIRCLE_COUNT);
}
}