-
Notifications
You must be signed in to change notification settings - Fork 5
/
squiggle.h
32 lines (24 loc) · 857 Bytes
/
squiggle.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
// Copyright...
#ifndef PDFSKETCH_SQUIGGLE_H__
#define PDFSKETCH_SQUIGGLE_H__
#include "graphic.h"
namespace pdfsketch {
class Squiggle : public Graphic {
public:
Squiggle() {}
explicit Squiggle(const pdfsketchproto::Graphic& msg);
virtual void Serialize(pdfsketchproto::Graphic* out) const;
virtual void Place(int page, const Point& location);
virtual void PlaceUpdate(const Point& location);
virtual bool PlaceComplete();
virtual void Draw(cairo_t* cr, bool selected);
private:
std::vector<Point> points_;
// original_origin_ combined with natural_size_ form a rectangle
// that represents where the original points came down. These points
// are stored in points_, and during draw, the path is transformed
// to the current frame.
Point original_origin_;
};
} // namespace pdfsketch
#endif // PDFSKETCH_SQUIGGLE_H__