mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-10 20:04:46 +00:00
forgotten files
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4560 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
30b0c731b4
commit
736d068866
11
src/mathed/dimension.C
Normal file
11
src/mathed/dimension.C
Normal 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
31
src/mathed/dimension.h
Normal 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
|
Loading…
Reference in New Issue
Block a user