From 85f33e13c70a523df6554f0983e84777266563e4 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Sun, 6 Oct 2019 13:27:11 +0300 Subject: [PATCH] Fix some edge cases where the AOChar qlabel is moved around in weird ways (reload theme still puts qlabel at 0,0 without centering) Fix a full message of speed 0 not properly displaying itself --- src/aocharmovie.cpp | 3 +-- src/courtroom.cpp | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/aocharmovie.cpp b/src/aocharmovie.cpp index f8dc8d2..b05d7f6 100644 --- a/src/aocharmovie.cpp +++ b/src/aocharmovie.cpp @@ -240,7 +240,6 @@ QPixmap AOCharMovie::get_pixmap(QImage image) f_pixmap = f_pixmap.scaledToHeight(f_h, transform_mode); this->resize(f_pixmap.size()); - QLabel::move(x + (f_w - f_pixmap.width())/2, y + (f_h - f_pixmap.height())); //Always center horizontally, always put at the bottom vertically return f_pixmap; } @@ -248,7 +247,7 @@ QPixmap AOCharMovie::get_pixmap(QImage image) void AOCharMovie::set_frame(QPixmap f_pixmap) { this->setPixmap(f_pixmap); - QLabel::move(x + (this->width() - this->pixmap()->width())/2, y); + QLabel::move(x + (f_w - f_pixmap.width())/2, y + (f_h - f_pixmap.height())); //Always center horizontally, always put at the bottom vertically } void AOCharMovie::combo_resize(int w, int h) diff --git a/src/courtroom.cpp b/src/courtroom.cpp index 0cf5a32..1145b34 100644 --- a/src/courtroom.cpp +++ b/src/courtroom.cpp @@ -2605,7 +2605,7 @@ void Courtroom::chat_tick() next_character_is_not_special = false; } - if (formatting_char || (message_display_speed[current_display_speed] <= 0 && tick_pos < f_message.size())) + if ((message_display_speed[current_display_speed] <= 0 && tick_pos < f_message.size()-1) || formatting_char) { chat_tick_timer->start(0); //Don't bother rendering anything out as we're doing the SPEED. (there's latency otherwise) if (!formatting_char || f_character == "n")