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
3
Pencil2D - Traditional Animation Software
4
Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon
5
Copyright (C) 2012-2020 Matthew Chiawen Chang
6
7
This program is free software; you can redistribute it and/or
8
modify it under the terms of the GNU General Public License
9
as published by the Free Software Foundation; version 2 of the License.
10
11
This program is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
GNU General Public License for more details.
15
16
*/
17
#ifndef CANVASCURSORPAINTER_H
18
#define CANVASCURSORPAINTER_H
19
20
#include <QPen>
21
22
class
QPainter
;
23
24
struct
CanvasCursorPainterOptions
25
{
26
QRectF
widthRect;
27
QRectF
featherRect;
28
bool
isAdjusting =
false
;
29
bool
useFeather =
false
;
30
bool
showCursor =
false
;
31
};
32
33
class
CanvasCursorPainter
34
{
35
36
public
:
37
CanvasCursorPainter
();
38
void
paint(
QPainter
& painter,
const
QRect
& blitRect);
39
40
void
preparePainter(
const
CanvasCursorPainterOptions
& painterOptions,
const
QTransform
& viewTransform);
41
42
const
QRect
dirtyRect() {
return
mDirtyRect; }
43
bool
isDirty()
const
{
return
mIsDirty; }
44
void
clearDirty();
45
46
private
:
47
48
void
setupPen();
49
51
void
paintWidthCursor
(
QPainter
& painter,
const
QRect
& blitRect,
const
QRectF
& widthCircleBounds);
52
void
paintFeatherCursor(
QPainter
& painter,
const
QRect
& blitRect,
const
QRectF
& widthCircleBounds,
const
QRectF
& featherCircleBounds);
53
54
CanvasCursorPainterOptions
mOptions;
55
QRect
mDirtyRect;
56
bool
mIsDirty =
false
;
57
58
QPen
mCursorPen;
59
};
60
61
#endif
// CANVASCURSORPAINTER_H
CanvasCursorPainter
Definition:
canvascursorpainter.h:34
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:78
QPainter
QPen
QRect
QRectF
QTransform
CanvasCursorPainterOptions
Definition:
canvascursorpainter.h:25