mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
Freehand curve tool
This commit is contained in:
@ -191,6 +191,42 @@ private:
|
||||
QColor m_fillColor;
|
||||
};
|
||||
|
||||
class PDFFORQTLIBSHARED_EXPORT PDFCreateFreehandCurveTool : public PDFCreateAnnotationTool
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private:
|
||||
using BaseClass = PDFCreateAnnotationTool;
|
||||
|
||||
public:
|
||||
explicit PDFCreateFreehandCurveTool(PDFDrawWidgetProxy* proxy, PDFToolManager* toolManager, QAction* action, QObject* parent);
|
||||
|
||||
virtual void drawPage(QPainter* painter, PDFInteger pageIndex,
|
||||
const PDFPrecompiledPage* compiledPage,
|
||||
PDFTextLayoutGetter& layoutGetter,
|
||||
const QMatrix& pagePointToDevicePointMatrix,
|
||||
QList<PDFRenderError>& errors) const override;
|
||||
|
||||
virtual void mousePressEvent(QWidget* widget, QMouseEvent* event) override;
|
||||
virtual void mouseReleaseEvent(QWidget* widget, QMouseEvent* event) override;
|
||||
virtual void mouseMoveEvent(QWidget* widget, QMouseEvent* event) override;
|
||||
|
||||
PDFReal getPenWidth() const;
|
||||
void setPenWidth(const PDFReal& penWidth);
|
||||
|
||||
QColor getStrokeColor() const;
|
||||
void setStrokeColor(const QColor& strokeColor);
|
||||
|
||||
private:
|
||||
void resetTool();
|
||||
|
||||
PDFToolManager* m_toolManager;
|
||||
PDFInteger m_pageIndex;
|
||||
std::vector<QPointF> m_pickedPoints;
|
||||
PDFReal m_penWidth;
|
||||
QColor m_strokeColor;
|
||||
};
|
||||
|
||||
} // namespace pdf
|
||||
|
||||
#endif // PDFADVANCEDTOOLS_H
|
||||
|
Reference in New Issue
Block a user