mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-11 21:27:01 -04:00
Basic text rendering working;
Added Font (done) and SymbolFont (skeleton); Added styling to set; Added CountourMap; Some script fixes git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@73 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
+25
-5
@@ -41,7 +41,7 @@ class RealSize {
|
||||
{}
|
||||
|
||||
/// Addition of two sizes
|
||||
inline void operator += (const RealSize& s2) {
|
||||
/* inline void operator += (const RealSize& s2) {
|
||||
width += s2.width;
|
||||
height += s2.height;
|
||||
}
|
||||
@@ -62,7 +62,7 @@ class RealSize {
|
||||
inline RealSize operator - () const {
|
||||
return RealSize(-width, -height);
|
||||
}
|
||||
|
||||
*/
|
||||
/// Multiplying a size by a scalar r, multiplies both components
|
||||
inline void operator *= (double r) {
|
||||
width *= r;
|
||||
@@ -83,6 +83,26 @@ class RealSize {
|
||||
}
|
||||
};
|
||||
|
||||
/// Add two sizes horizontally
|
||||
/** #### $$$ ####$$$
|
||||
* #### + $$$ = ####$$$
|
||||
* #### ####...
|
||||
*/
|
||||
inline RealSize addHorizontal(const RealSize& a, const RealSize& b) {
|
||||
return RealSize(a.width + b.width, max(a.height, b.height));
|
||||
}
|
||||
|
||||
/// Add two sizes vertically
|
||||
/** #### $$$ ####
|
||||
* #### + $$$ = ####
|
||||
* #### ####
|
||||
* $$$.
|
||||
* $$$.
|
||||
*/
|
||||
inline RealSize addVertical(const RealSize& a, const RealSize& b) {
|
||||
return RealSize(max(a.width, b.width), a.height + b.height);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------- : Rectangle using doubles
|
||||
|
||||
/// A rectangle (postion and size) using real (double) coordinats
|
||||
@@ -110,9 +130,9 @@ class RealRect {
|
||||
inline RealRect grow(double amount) {
|
||||
return RealRect(position.x - amount, position.y - amount, size.width + 2 * amount, size.height + 2 * amount);
|
||||
}
|
||||
|
||||
inline RealRect operator + (const RealRect& r) const {
|
||||
return RealRect(position + r.position, size + r.size);
|
||||
/// Move the coordinates by some amount
|
||||
inline RealRect move(double dx, double dy, double dw, double dh) {
|
||||
return RealRect(position.x + dx, position.y + dy, size.width + dw, size.height + dh);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user