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++
965 B
Raw Blame
/*
 * KDE. Krita Project.
 *
 * SPDX-FileCopyrightText: 2022 Deif Lou <[email protected]>
 *
 * SPDX-License-Identifier: GPL-2.0-or-later
 */

#ifndef KISRECTANGLEENCLOSINGPRODUCER
#define KISRECTANGLEENCLOSINGPRODUCER

#include <kis_tool_rectangle_base.h>
#include <kis_pixel_selection.h>

#include "KisDynamicDelegatedTool.h"

class KisRectangleEnclosingProducer : public KisDynamicDelegateTool<KisToolRectangleBase>
{
    Q_OBJECT

public:
    KisRectangleEnclosingProducer(KoCanvasBase *canvas);
    ~KisRectangleEnclosingProducer() override;
    
    bool hasUserInteractionRunning() const;

protected:
    void finishRect(const QRectF& rect, qreal roundCornersX, qreal roundCornersY) override;
    void beginShape() override;
    void endShape() override;

Q_SIGNALS:
    void enclosingMaskProduced(KisPixelSelectionSP enclosingMask);

private:
    bool m_hasUserInteractionRunning {false};

protected Q_SLOTS:
    void resetCursorStyle() override;
};

#endif