2
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
4
* This program is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU General Public License as
6
* published by the Free Software Foundation; version 2 of the
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., 51 Franklin St, Fifth Floor, Boston, MA
22
#include "mdc_vertex_handle.h"
25
using namespace MySQL::Geometry;
26
using namespace MySQL::Drawing;
28
VertexHandle::VertexHandle(InteractionLayer *ilayer, CanvasItem *item, const Point &pos, bool connectable)
29
: ItemHandle(ilayer, item, pos), _connectable(connectable)
34
VertexHandle::~VertexHandle()
39
void VertexHandle::repaint(CairoCtx *cr)
43
cr->set_color(Color(1, 1, 1, 0.8));
44
cr->set_line_width(1);
47
cr->move_to(r.left() + r.width()/2, r.top());
48
cr->line_to(r.left(), r.top() + r.height()/2);
49
cr->line_to(r.left() + r.width()/2, r.bottom());
50
cr->line_to(r.right(), r.top() + r.height()/2);
60
cr->set_color(Color(0, 1, 1, 1));
62
cr->set_color(Color(0.0, 0.0, 0.9, 1));
67
Rect VertexHandle::get_bounds() const
70
r.pos.x= _pos.x - 4.5;
71
r.pos.y= _pos.y - 4.5;