NOOP, remove trailing tabs/whitespace.
[ardour.git] / libs / canvas / test / arrow.cc
1 #include "canvas/group.h"
2 #include "canvas/types.h"
3 #include "canvas/arrow.h"
4 #include "canvas/canvas.h"
5 #include "arrow.h"
6
7 using namespace std;
8 using namespace ArdourCanvas;
9
10 CPPUNIT_TEST_SUITE_REGISTRATION (ArrowTest);
11
12 void
13 ArrowTest::bounding_box ()
14 {
15         ImageCanvas canvas;
16         Arrow arrow (canvas.root ());
17
18         for (int i = 0; i < 2; ++i) {
19                 arrow.set_show_head (i, true);
20                 arrow.set_head_outward (i, true);
21                 arrow.set_head_height (i, 16);
22                 arrow.set_head_width (i, 12);
23                 arrow.set_x (0);
24                 arrow.set_y0 (0);
25                 arrow.set_y1 (128);
26         }
27
28         arrow.set_outline_width (0);
29
30         boost::optional<Rect> bbox = arrow.bounding_box ();
31
32         CPPUNIT_ASSERT (bbox.is_initialized ());
33         CPPUNIT_ASSERT (bbox.get().x0 == -6);
34         CPPUNIT_ASSERT (bbox.get().y0 == 0);
35         CPPUNIT_ASSERT (bbox.get().x1 == 6);
36         CPPUNIT_ASSERT (bbox.get().y1 == 128);
37 }