aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/aolayer.cpp9
-rw-r--r--src/courtroom.cpp5
2 files changed, 7 insertions, 7 deletions
diff --git a/src/aolayer.cpp b/src/aolayer.cpp
index 4ac7d486..a70e7b82 100644
--- a/src/aolayer.cpp
+++ b/src/aolayer.cpp
@@ -91,6 +91,7 @@ QPixmap AOLayer::get_pixmap(QImage image)
// auto aspect_ratio = Qt::KeepAspectRatio;
if (!f_pixmap.isNull())
{
+ scaling_factor = float(f_h) / float(f_pixmap.height());
if (f_pixmap.height() > f_h) // We are downscaling, use anti-aliasing.
{
transform_mode = Qt::SmoothTransformation;
@@ -118,7 +119,6 @@ void AOLayer::center_pixmap(QPixmap f_pixmap)
{
if (g_center == -1)
{
- centered_offset = (f_w - f_pixmap.width()) / 2;
QLabel::move(x + (f_w - f_pixmap.width()) / 2,
y + (f_h - f_pixmap.height())); // Always center horizontally, always
// put at the bottom vertically
@@ -142,16 +142,13 @@ void AOLayer::center_pixmap(QPixmap f_pixmap)
}
}
-int AOLayer::get_centered_offset()
-{
- return centered_offset;
-}
-
int AOLayer::get_pos_from_center(int f_center)
{
int center_scaled = int(float(f_center) * scaling_factor);
int f_pos = x + (center_scaled - (f_w / 2)) * -1;
+#ifdef DEBUG_MOVIE
qDebug() << "centering image at center" << f_center << "final position" << f_pos;
+#endif
return f_pos;
}
diff --git a/src/courtroom.cpp b/src/courtroom.cpp
index 0d7dd6d7..2f7e3ed5 100644
--- a/src/courtroom.cpp
+++ b/src/courtroom.cpp
@@ -2303,7 +2303,10 @@ void Courtroom::on_chat_return_pressed()
}
}
- packet_contents.append(ao_app->get_blipname(current_char, current_emote));
+ if (ao_app->m_serverdata.get_feature(server::BASE_FEATURE_SET::CUSTOM_BLIPS)) {
+ packet_contents.append(ao_app->get_blipname(current_char, current_emote));
+ }
+ packet_contents.append(ui_slide_enable->isChecked() ? "1" : "0"); // just let the server figure out what to do with this
ao_app->send_server_packet(AOPacket("MS", packet_contents));
}