-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcheckmark.cc
More file actions
34 lines (27 loc) · 818 Bytes
/
checkmark.cc
File metadata and controls
34 lines (27 loc) · 818 Bytes
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
// Copyright...
#include "checkmark.h"
namespace pdfsketch {
void Checkmark::Serialize(pdfsketchproto::Graphic* out) const {
Graphic::Serialize(out);
out->set_type(pdfsketchproto::Graphic::CHECKMARK);
}
void Checkmark::Place(int page, const Point& location) {
page_ = page;
frame_.size_ = Size(9.0, 9.0);
PlaceUpdate(location);
}
void Checkmark::PlaceUpdate(const Point& location) {
SetNeedsDisplay(false);
frame_.SetCenter(location);
SetNeedsDisplay(false);
}
void Checkmark::Draw(cairo_t* cr, bool selected) {
stroke_color_.CairoSetSourceRGBA(cr);
cairo_set_line_width(cr, line_width_);
frame_.UpperLeft().CairoMoveTo(cr);
frame_.LowerRight().CairoLineTo(cr);
frame_.UpperRight().CairoMoveTo(cr);
frame_.LowerLeft().CairoLineTo(cr);
cairo_stroke(cr);
}
} // namespace pdfsketch