add missing code from rebase

This commit is contained in:
in1tiate 2024-05-20 09:03:16 -05:00
parent 6ff71de06b
commit a23614059b
2 changed files with 7 additions and 7 deletions

View File

@ -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;
}

View File

@ -2303,7 +2303,10 @@ void Courtroom::on_chat_return_pressed()
}
}
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));
}