/
StrokeView.h
57 lines (45 loc) · 996 Bytes
/
StrokeView.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
* Xournal++
*
* Draw stroke
*
* @author Xournal++ Team
* https://github.com/xournalpp/xournalpp
*
* @license GNU GPLv2 or later
*/
#pragma once
#include <gtk/gtk.h>
class Stroke;
class StrokeView
{
public:
StrokeView(cairo_t* cr, Stroke* s, int startPoint, double scaleFactor, bool noAlpha);
~StrokeView();
public:
void paint(bool dontRenderEditingStroke);
/**
* Change cairo source, used to draw hilighter transparent,
* but only if not currently drawing and so on (yes, complicated)
*/
void changeCairoSource(bool markAudioStroke);
private:
void drawFillStroke();
void applyDashed(double offset);
void drawEraseableStroke(cairo_t* cr, Stroke* s);
/**
* No pressure sensitivity, one line is drawn
*/
void drawNoPressure();
/**
* Draw a stroke with pressure, for this multiple
* lines with different widths needs to be drawn
*/
void drawWithPressure();
private:
cairo_t* cr;
Stroke* s;
int startPoint;
double scaleFactor;
bool noAlpha;
};