Cleaned up the Alignment type, it is now much more orthogonal.

Changed the behavior of justifying:
 - by default justify words instead of characters
 - only justify before soft line breaks, unless "alignment: force justify" is used.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1251 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2008-12-11 19:17:55 +00:00
parent 310dc1333d
commit fee64d283f
5 changed files with 63 additions and 43 deletions
+2 -2
View File
@@ -57,9 +57,9 @@ TextStyle::TextStyle(const TextFieldP& field)
{}
double TextStyle::getStretch() const {
if (content_width > 0 && ((alignment() & ALIGN_STRETCH) || (alignment() & ALIGN_STRETCH_OVERFLOW))) {
if (content_width > 0 && (alignment() & ALIGN_STRETCH)) {
double factor = (width - padding_left - padding_right) / content_width;
if (alignment() == ALIGN_STRETCH || factor < 1.0) {
if (!(alignment() & ALIGN_IF_OVERFLOW) || factor < 1.0) {
return factor;
}
}