ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/cf.schmorp.de/dclient/src/backend/ndk/align.cpp
Revision: 1.1
Committed: Sun Oct 17 08:15:08 2010 UTC (16 years ago) by sf-pippijn
Branch: MAIN
Log Message:
initial import

File Contents

# User Rev Content
1 sf-pippijn 1.1 /* align.cc
2     * This file is part of NDK++ library
3     * Copyright (c) 2003 by Stanislav Ievlev
4     *
5     * This file is covered by the GNU Library General Public License,
6     * which should be included with libndk++ as the file COPYING.
7     */
8     #include <ndk++/align.hh>
9    
10     int
11     ndk::align::pos (int internal_size, int external_size, align::type align)
12     {
13     switch (align)
14     {
15     case left:
16     return 0;
17     case right:
18     return external_size - internal_size;
19     case center:
20     return (external_size - internal_size) / 2;
21     default:
22     throw "unknown align type";
23     }
24     }