Skip to content

Commit

Permalink
Update courtroom.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Satoru-1816 authored Jan 14, 2025
1 parent 74a5c24 commit d934e52
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/courtroom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3208,21 +3208,18 @@ void Courtroom::do_character_slide(QWidget *widget)
int self_offset = self_offsets[0].toInt();
int self_offset_v = (self_offsets.length() > 1) ? self_offsets[1].toInt() : 0;

AOLayer *layer = dynamic_cast<AOLayer *>(widget);
if (!layer) return;

// Calcula las posiciones centradas
layer->move_and_center(
widget->move_and_center(
ui_viewport->width() * last_x_offset / 100,
ui_viewport->height() * char_vert_offset / 100
);
QPoint old_pos(layer->x, layer->y);
QPoint old_pos(widget->x, widget->y);

layer->move_and_center(
widget->move_and_center(
ui_viewport->width() * self_offset / 100,
ui_viewport->height() * self_offset_v / 100
);
QPoint new_pos(layer->x, layer->y);
QPoint new_pos(widget->x, widget->y);

QPropertyAnimation *slide_animation = new QPropertyAnimation(widget, "pos", this);
slide_animation->setDuration(500);
Expand Down

0 comments on commit d934e52

Please sign in to comment.