Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++
1.2 KB
Raw Blame
/* This file is part of the KDE project
 * SPDX-FileCopyrightText: 2006 Jan Hambrecht <[email protected]>
 * SPDX-FileCopyrightText: 2006 Thorsten Zachmann <[email protected]>
 *
 * SPDX-License-Identifier: LGPL-2.0-or-later
 */

#ifndef KOPATHPOINTMOVESTRATEGY_H
#define KOPATHPOINTMOVESTRATEGY_H

#include <QPointF>
#include <QScopedPointer>
#include "KoInteractionStrategy.h"

#include <memory>

class KoPathTool;

/**
 * @brief Strategy for moving points of a path shape.
 */
class KoPathPointMoveStrategy : public KoInteractionStrategy
{
public:
    KoPathPointMoveStrategy(KoPathTool *tool, const QPointF &mousePosition, const QPointF &pointPosition);
    ~KoPathPointMoveStrategy() override;
    void handleMouseMove(const QPointF &mouseLocation, Qt::KeyboardModifiers modifiers) override;
    void finishInteraction(Qt::KeyboardModifiers modifiers) override;
    KUndo2Command *createCommand() override;

private:
    QPointF m_startMousePosition;
    QPointF m_startPointPosition;
    /// the accumulated point move amount
    QPointF m_move;
    /// pointer to the path tool
    KoPathTool *m_tool;
    std::unique_ptr<KUndo2Command> m_intermediateCommand;
};

#endif /* KOPATHPOINTMOVESTRATEGY_H */