fixed multiline message positioning

svn-id: r46264
This commit is contained in:
Vladimir Menshakov 2009-12-05 06:03:24 +00:00
parent 7aa92b7dcc
commit 19eff3b774

View File

@ -971,8 +971,13 @@ Object *Scene::getObject(int id, int scene_id) {
Common::Point Scene::messagePosition(const Common::String &str, Common::Point position) {
Resources *res = Resources::instance();
int lines = 1;
for(uint i = 0; i < str.size(); ++i)
if (str[i] == '\n')
++lines;
uint w = res->font7.render(NULL, 0, 0, str, 0);
uint h = res->font7.height + 3;
uint h = res->font7.height * lines + 3;
position.x -= w / 2;
position.y -= h;