xref: /haiku/src/kits/interface/layouter/Layouter.cpp (revision 9ecf9d1c1d4888d341a6eac72112c72d1ae3a4cb)
1 /*
2  * Copyright 2006, Ingo Weinhold <bonefish@cs.tu-berlin.de>.
3  * All rights reserved. Distributed under the terms of the MIT License.
4  */
5 
6 #include "Layouter.h"
7 
8 
9 // constructor
LayoutInfo()10 LayoutInfo::LayoutInfo()
11 {
12 }
13 
14 // destructor
~LayoutInfo()15 LayoutInfo::~LayoutInfo()
16 {
17 }
18 
19 // ElementRangeSize
20 float
ElementRangeSize(int32 position,int32 length)21 LayoutInfo::ElementRangeSize(int32 position, int32 length)
22 {
23 	if (length == 1)
24 		return ElementSize(position);
25 
26 	int lastIndex = position + length - 1;
27 	return ElementLocation(lastIndex) + ElementSize(lastIndex)
28 		- ElementLocation(position);
29 }
30 
31 
32 // #pragma mark -
33 
34 
35 // constructor
Layouter()36 Layouter::Layouter()
37 {
38 }
39 
40 // destructor
~Layouter()41 Layouter::~Layouter()
42 {
43 }
44