2 Situare - A location system for Facebook
3 Copyright (C) 2010 Ixonos Plc. Authors:
5 Ville Tiensuu - ville.tiensuu@ixonos.com
6 Sami Rämö - sami.ramo@ixonos.com
8 Situare is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 version 2 as published by the Free Software Foundation.
12 Situare is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with Situare; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
25 #include "mapcommon.h"
27 #include "baselocationitem.h"
29 BaseLocationItem::BaseLocationItem(QObject *parent)
32 qDebug() << __PRETTY_FUNCTION__;
34 setFlag(QGraphicsItem::ItemIgnoresTransformations);
37 QRect BaseLocationItem::sceneTransformedBoundingRect(int zoomLevel) const
39 QRect rect = sceneBoundingRect().toRect();
40 int multiplier = 1 << (MAX_MAP_ZOOM_LEVEL - zoomLevel);
42 int heightDelta = (rect.height() * multiplier - rect.height()) / 2;
43 int widthDelta = (rect.width() * multiplier - rect.width()) / 2;
45 return rect.adjusted(-widthDelta, -heightDelta, widthDelta, heightDelta);