mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 13:06:59 -04:00
implemented justification;
fixed initialization bug in item_list; commented out statistics fields for debugging and added 'match' for all keywords in magic.mse-game git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@279 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -36,15 +36,15 @@ RealPoint align_in_rect(Alignment align, const RealSize& to_align, const RealRec
|
||||
/// Convert a String to an Alignment
|
||||
Alignment from_string(const String& s) {
|
||||
int al = ALIGN_TOP_LEFT;
|
||||
if (s.find(_("left")) !=String::npos) al = ALIGN_LEFT | (al & ALIGN_VERTICAL);
|
||||
if (s.find(_("center")) !=String::npos) al = ALIGN_CENTER | (al & ALIGN_VERTICAL);
|
||||
if (s.find(_("right")) !=String::npos) al = ALIGN_RIGHT | (al & ALIGN_VERTICAL);
|
||||
if (s.find(_("justify")) !=String::npos) al = ALIGN_JUSTIFY | (al & ALIGN_VERTICAL);
|
||||
if (s.find(_("justify-words")) !=String::npos) al = ALIGN_JUSTIFY_WORDS | (al & ALIGN_VERTICAL);
|
||||
if (s.find(_("left")) !=String::npos) al = ALIGN_LEFT | (al & ~ALIGN_HORIZONTAL);
|
||||
if (s.find(_("center")) !=String::npos) al = ALIGN_CENTER | (al & ~ALIGN_HORIZONTAL);
|
||||
if (s.find(_("right")) !=String::npos) al = ALIGN_RIGHT | (al & ~ALIGN_HORIZONTAL);
|
||||
if (s.find(_("justify")) !=String::npos) al = ALIGN_JUSTIFY | (al & ~ALIGN_HORIZONTAL);
|
||||
if (s.find(_("justify-words")) !=String::npos) al = ALIGN_JUSTIFY_WORDS | (al & ~ALIGN_HORIZONTAL);
|
||||
if (s.find(_("shrink-overflow"))!=String::npos) al = ALIGN_JUSTIFY_OVERFLOW | (al & ~ALIGN_JUSTIFY_OVERFLOW);
|
||||
if (s.find(_("top")) !=String::npos) al = ALIGN_TOP | (al & ALIGN_HORIZONTAL);
|
||||
if (s.find(_("middle")) !=String::npos) al = ALIGN_MIDDLE | (al & ALIGN_HORIZONTAL);
|
||||
if (s.find(_("bottom")) !=String::npos) al = ALIGN_BOTTOM | (al & ALIGN_HORIZONTAL);
|
||||
if (s.find(_("top")) !=String::npos) al = ALIGN_TOP | (al & ~ALIGN_VERTICAL);
|
||||
if (s.find(_("middle")) !=String::npos) al = ALIGN_MIDDLE | (al & ~ALIGN_VERTICAL);
|
||||
if (s.find(_("bottom")) !=String::npos) al = ALIGN_BOTTOM | (al & ~ALIGN_VERTICAL);
|
||||
if (s.find(_("stretch")) !=String::npos) al = ALIGN_STRETCH;
|
||||
return static_cast<Alignment>(al);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user