vfs: check userland buffers before reading them.
[haiku.git] / src / kits / interface / layouter / Layouter.cpp
blob6c4908de1d1159d06ad687829af45cbc4745da95
1 /*
2 * Copyright 2006, Ingo Weinhold <bonefish@cs.tu-berlin.de>.
3 * All rights reserved. Distributed under the terms of the MIT License.
4 */
6 #include "Layouter.h"
9 // constructor
10 LayoutInfo::LayoutInfo()
14 // destructor
15 LayoutInfo::~LayoutInfo()
19 // ElementRangeSize
20 float
21 LayoutInfo::ElementRangeSize(int32 position, int32 length)
23 if (length == 1)
24 return ElementSize(position);
26 int lastIndex = position + length - 1;
27 return ElementLocation(lastIndex) + ElementSize(lastIndex)
28 - ElementLocation(position);
32 // #pragma mark -
35 // constructor
36 Layouter::Layouter()
40 // destructor
41 Layouter::~Layouter()