text simple placement: add center 'C' placement

This commit is contained in:
Jiri Drbalek 2017-01-08 09:05:44 +00:00
parent 10deff9d5d
commit 4eae86b7bc
3 changed files with 5 additions and 1 deletions

View file

@ -96,7 +96,8 @@ enum directions_e : std::uint8_t
SOUTHEAST,
NORTHWEST,
SOUTHWEST,
EXACT_POSITION
EXACT_POSITION,
CENTER
};
using fontset_map = std::map<std::string, font_set>;

View file

@ -57,6 +57,7 @@ struct direction_name : x3::symbols<directions_e>
("NW", NORTHWEST)
("SW", SOUTHWEST)
("X" , EXACT_POSITION)
("C" , CENTER)
;
}
} names;

View file

@ -79,6 +79,8 @@ pixel_position evaluate_displacement(double dx, double dy, directions_e dir)
return pixel_position(-std::abs(dx),-std::abs(dy));
case SOUTHWEST:
return pixel_position(-std::abs(dx),std::abs(dy));
case CENTER:
return pixel_position(0, 0);
default:
return pixel_position(dx,dy);
}