forgotten files

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4560 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2002-07-09 08:44:30 +00:00
parent 30b0c731b4
commit 736d068866
2 changed files with 42 additions and 0 deletions

11
src/mathed/dimension.C Normal file
View File

@ -0,0 +1,11 @@
#include "dimension.h"
void Dimension::operator+=(Dimension const & dim)
{
if (a < dim.a)
a = dim.a;
if (d < dim.d)
d = dim.d;
w += dim.w;
}

31
src/mathed/dimension.h Normal file
View File

@ -0,0 +1,31 @@
#ifndef DIMENSION_H
#define DIMENSION_H
class Dimension {
public:
/// constructor
Dimension() : w(0), a(0), d(0) {}
/// initialize data
Dimension(int ww, int aa, int dd) : w(ww), a(aa), d(dd) {}
/// glue horizontally
void operator+=(Dimension const & dim);
/// set to empty box
void clear() { w = a = d = 0; }
/// get height
int height() const { return a + d; }
/// get ascent
int ascent() const { return a; }
/// get width
int width() const { return w; }
public:
/// width
int w;
/// ascent
int a;
/// descent
int d;
};
#endif