2 Copyright (C) 2014 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #include <cairomm/context.h>
21 #include "pbd/stacktrace.h"
22 #include "pbd/compose.h"
24 #include "canvas/drag_handle.h"
26 using namespace ArdourCanvas;
28 DragHandle::DragHandle (Group* g, Rect const & r, bool left_side)
31 , _left_side (left_side)
36 DragHandle::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) const
38 Rectangle::render (area, context);
41 Duple circle_center (_left_side ? x0() : x1(), (y1() - y0())/2.0);
42 Duple window_circle_center = item_to_window (circle_center);
44 context->set_source_rgba (1.0, 0.0, 0.0, 1.0);
47 context->arc (window_circle_center.x, window_circle_center.y, 7.0, -M_PI/2.0, +M_PI/2.0);
49 context->arc_negative (window_circle_center.x, window_circle_center.y, 7.0, -M_PI/2.0, +M_PI/2.0);