mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 13:06:59 -04:00
Fixed TextCtrl to work for keyword properties;
Added wrapping of <> around parameters to TextElement; Added colors for keyword parameters; Added menu & toolbar for keyword panel; Fixed bug in package, save/save-as was the wrong way around; Added third quality setting to RotatedDC: using SetUserScale, this gets you more precise positioning. git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@250 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -79,3 +79,24 @@ template <> void Writer::handle(const Alignment& align) {
|
||||
template <> void GetDefaultMember::handle(const Alignment& align) {
|
||||
handle(to_string(align));
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------- : Direction
|
||||
|
||||
IMPLEMENT_REFLECTION_ENUM(Direction) {
|
||||
VALUE_N("left to right", LEFT_TO_RIGHT);
|
||||
VALUE_N("right to left", RIGHT_TO_LEFT);
|
||||
VALUE_N("top to bottom", TOP_TO_BOTTOM);
|
||||
VALUE_N("bottom to top", BOTTOM_TO_TOP);
|
||||
VALUE_N("horizontal", LEFT_TO_RIGHT);
|
||||
VALUE_N("vertical", TOP_TO_BOTTOM);
|
||||
}
|
||||
|
||||
RealPoint move_in_direction(Direction dir, const RealPoint& point, const RealSize to_move, double spacing) {
|
||||
switch (dir) {
|
||||
case LEFT_TO_RIGHT: return RealPoint(point.x + to_move.width + spacing, point.y);
|
||||
case RIGHT_TO_LEFT: return RealPoint(point.x - to_move.width - spacing, point.y);
|
||||
case TOP_TO_BOTTOM: return RealPoint(point.x, point.y + to_move.height + spacing);
|
||||
case BOTTOM_TO_TOP: return RealPoint(point.x, point.y - to_move.height - spacing);
|
||||
default: return point; // should not happen
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user