Pencil2D Animation
Download Community News Docs Contribute
  • Overview
  • Articles
  • Code
  •  
  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • File List
Loading...
Searching...
No Matches
  • core_lib
  • src
canvascursorpainter.h
1/*
2
3Pencil2D - Traditional Animation Software
4Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon
5Copyright (C) 2012-2020 Matthew Chiawen Chang
6
7This program is free software; you can redistribute it and/or
8modify it under the terms of the GNU General Public License
9as published by the Free Software Foundation; version 2 of the License.
10
11This program is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16*/
17#ifndef CANVASCURSORPAINTER_H
18#define CANVASCURSORPAINTER_H
19
20#include <QPen>
21
22class QPainter;
23
24struct CanvasCursorPainterOptions
25{
26 QRectF circleRect;
27 bool showCursor = false;
28 bool showCross = false;
29};
30
31class CanvasCursorPainter
32{
33
34public:
35 CanvasCursorPainter();
36 void paint(QPainter& painter, const QRect& blitRect);
37
38 void preparePainter(const CanvasCursorPainterOptions& painterOptions);
39
40 const QRect dirtyRect() { return mDirtyRect; }
41 bool isDirty() const { return mIsDirty; }
42 void clearDirty();
43
44private:
45
46 void setupPen();
47
49 void paintWidthCursor(QPainter& painter, const QRect& blitRect, const QRectF& widthCircleBounds);
50
51 CanvasCursorPainterOptions mOptions;
52 QRect mDirtyRect;
53 bool mIsDirty = false;
54
55 QPen mCursorPen;
56};
57
58#endif // CANVASCURSORPAINTER_H
CanvasCursorPainter
Definition: canvascursorpainter.h:32
CanvasCursorPainter::paintWidthCursor
void paintWidthCursor(QPainter &painter, const QRect &blitRect, const QRectF &widthCircleBounds)
precision circular cursor: used for drawing a cursor on the canvas.
Definition: canvascursorpainter.cpp:47
QPainter
QPen
QRect
QRectF
CanvasCursorPainterOptions
Definition: canvascursorpainter.h:25
Generated on Mon Dec 15 2025 03:41:35 for Pencil2D by doxygen 1.9.6 based on revision 9bfef078cfa681fa5250352bbcb5a69281765ae9