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.
29 lines
679 B
C++
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);
|
|
}
|
|
}
|