implemented symbol font

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@81 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2006-11-20 14:48:53 +00:00
parent dd34042c07
commit 141400d8aa
18 changed files with 346 additions and 44 deletions
+35
View File
@@ -103,6 +103,17 @@ inline RealSize addVertical(const RealSize& a, const RealSize& b) {
return RealSize(max(a.width, b.width), a.height + b.height);
}
/// Add two sizes diagonally
/** #### $$$ ####...
* #### + $$$ = ####...
* #### ####...
* ....$$$
* ....$$$
*/
inline RealSize addDiagonal(const RealSize& a, const RealSize& b) {
return RealSize(a.width + b.width, a.height + b.height);
}
// ----------------------------------------------------------------------------- : Rectangle using doubles
/// A rectangle (postion and size) using real (double) coordinats
@@ -136,6 +147,30 @@ class RealRect {
}
};
/// Split a rectangle horizontally
/** Returns a section from the left of this rectangle witht the given width
* The rectangle will change to become the part remaining to the right
* For example given a rectangle:
* +------------+
* | R |
* +------------+
* A = split_left(R,5)
* +----+-------+
* | A | R |
* +----+-------+
*/
inline RealRect split_left(RealRect& r, double w) {
RealRect result(r.position.x, r.position.y, w, r.size.height);
r.size.width -= w;
r.position.x += w;
return result;
}
/// Split a rectangle horizontally
inline RealRect split_left(RealRect& r, const RealSize& s) {
return split_left(r, s.width);
}
// ----------------------------------------------------------------------------- : Operators
inline RealPoint operator + (const RealSize& s, const RealPoint& p) {