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
+9 -6
View File
@@ -20,18 +20,21 @@ enum Alignment
{ ALIGN_LEFT = 0x01
, ALIGN_CENTER = 0x02
, ALIGN_RIGHT = 0x04
, ALIGN_JUSTIFY = 0x08
, ALIGN_JUSTIFY_WORDS = 0x10
, ALIGN_HORIZONTAL = ALIGN_LEFT | ALIGN_CENTER | ALIGN_RIGHT | ALIGN_JUSTIFY | ALIGN_JUSTIFY_WORDS
, ALIGN_HORIZONTAL = ALIGN_LEFT | ALIGN_CENTER | ALIGN_RIGHT
// horizontal filling
, ALIGN_STRETCH = 0x10
, ALIGN_JUSTIFY_WORDS = 0x20
, ALIGN_JUSTIFY_ALL = 0x40
, ALIGN_FILL = ALIGN_STRETCH | ALIGN_JUSTIFY_WORDS | ALIGN_JUSTIFY_ALL
// horizontal fill modifiers
, ALIGN_IF_OVERFLOW = 0x1000 // only fill if text_width > box_width
, ALIGN_IF_SOFTBREAK = 0x2000 // only fill before soft line breaks
// vertical
, ALIGN_TOP = 0x100
, ALIGN_MIDDLE = 0x200
, ALIGN_BOTTOM = 0x400
, ALIGN_VERTICAL = ALIGN_TOP | ALIGN_MIDDLE | ALIGN_BOTTOM
// modifiers
, ALIGN_JUSTIFY_OVERFLOW = 0x1000
, ALIGN_STRETCH_OVERFLOW = 0x2000
, ALIGN_STRETCH = 0x4000
// common combinations
, ALIGN_TOP_LEFT = ALIGN_TOP | ALIGN_LEFT
, ALIGN_TOP_CENTER = ALIGN_TOP | ALIGN_CENTER