2 * Copyright 2005 by Aaron Seigo <aseigo@kde.org>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Library General Public License as
6 * published by the Free Software Foundation; either version 2, 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 Library General Public
15 * License along with this program; if not, write to the
16 * Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
25 qreal
scalingFactor(ZoomLevel level
)
39 // to make odd compilers not warn like silly beasts
43 Direction
locationToDirection(Location location
)
51 //TODO: should we be smarter for floating and planer?
52 // perhaps we should take a QRect and/or QPos as well?
65 QPainterPath
roundedRectangle(const QRectF
& rect
, qreal radius
)
67 QPainterPath
path(QPointF(rect
.left(), rect
.top() + radius
));
68 path
.quadTo(rect
.left(), rect
.top(), rect
.left() + radius
, rect
.top()); // Top left corner
69 path
.lineTo(rect
.right() - radius
, rect
.top()); // Top side
70 path
.quadTo(rect
.right(), rect
.top(), rect
.right(), rect
.top() + radius
); // Top right corner
71 path
.lineTo(rect
.right(), rect
.bottom() - radius
); // Right side
72 path
.quadTo(rect
.right(), rect
.bottom(), rect
.right() - radius
, rect
.bottom()); // Bottom right corner
73 path
.lineTo(rect
.left() + radius
, rect
.bottom()); // Bottom side
74 path
.quadTo(rect
.left(), rect
.bottom(), rect
.left(), rect
.bottom() - radius
); // Bottom left corner