2
* This file is part of unity-2d
4
* Copyright 2010-2011 Canonical Ltd.
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; version 3.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program. If not, see <http://www.gnu.org/licenses/>.
22
property int horizontalSpacing: 0
23
property int verticalSpacing: 0
24
property int columns: 2
27
function delegateX(column) {
28
return column * horizontalSpacing / columns
30
function delegateY(row) {
31
return row * verticalSpacing / rows
34
property int delegateWidth: cellWidth - horizontalSpacing + horizontalSpacing / columns
35
property int delegateHeight: cellHeight - verticalSpacing + verticalSpacing / rows
36
cellWidth: delegateWidth + horizontalSpacing - horizontalSpacing / rows
37
cellHeight: delegateHeight + verticalSpacing - verticalSpacing / rows