mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-14 05:38:56 +00:00
fixed multiline message positioning
svn-id: r46264
This commit is contained in:
parent
7aa92b7dcc
commit
19eff3b774
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user