don't set a mask on elements affected by offsets (#524)

This commit is contained in:
in1tiate 2021-04-19 19:27:25 -05:00 committed by GitHub
parent 8f0913d30e
commit e517a365d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 3 deletions

View File

@ -52,6 +52,7 @@ public:
bool force_continuous = false; bool force_continuous = false;
Qt::TransformationMode transform_mode = Qt::FastTransformation; // transformation mode to use for this image Qt::TransformationMode transform_mode = Qt::FastTransformation; // transformation mode to use for this image
bool stretch = false; // Should we stretch/squash this image to fill the screen? bool stretch = false; // Should we stretch/squash this image to fill the screen?
bool masked = true; // Set a mask to the dimensions of the widget?
// Set the movie's image to provided paths, preparing for playback. // Set the movie's image to provided paths, preparing for playback.
void start_playback(QString p_image); void start_playback(QString p_image);

View File

@ -98,9 +98,10 @@ void AOLayer::center_pixmap(QPixmap f_pixmap) {
x + (f_w - f_pixmap.width()) / 2, x + (f_w - f_pixmap.width()) / 2,
y + (f_h - f_pixmap.height())); // Always center horizontally, always put y + (f_h - f_pixmap.height())); // Always center horizontally, always put
// at the bottom vertically // at the bottom vertically
this->setMask( if (masked)
QRegion((f_pixmap.width() - f_w) / 2, (f_pixmap.height() - f_h) / 2, f_w, this->setMask(
f_h)); // make sure we don't escape the area we've been given QRegion((f_pixmap.width() - f_w) / 2, (f_pixmap.height() - f_h) / 2, f_w,
f_h)); // make sure we don't escape the area we've been given
} }
void AOLayer::combo_resize(int w, int h) void AOLayer::combo_resize(int w, int h)

View File

@ -46,7 +46,9 @@ Courtroom::Courtroom(AOApplication *p_ao_app) : QMainWindow()
ui_vp_background = new BackgroundLayer(ui_viewport, ao_app); ui_vp_background = new BackgroundLayer(ui_viewport, ao_app);
ui_vp_speedlines = new SplashLayer(ui_viewport, ao_app); ui_vp_speedlines = new SplashLayer(ui_viewport, ao_app);
ui_vp_player_char = new CharLayer(ui_viewport, ao_app); ui_vp_player_char = new CharLayer(ui_viewport, ao_app);
ui_vp_player_char->masked = false;
ui_vp_sideplayer_char = new CharLayer(ui_viewport, ao_app); ui_vp_sideplayer_char = new CharLayer(ui_viewport, ao_app);
ui_vp_sideplayer_char->masked = false;
ui_vp_sideplayer_char->hide(); ui_vp_sideplayer_char->hide();
ui_vp_desk = new BackgroundLayer(ui_viewport, ao_app); ui_vp_desk = new BackgroundLayer(ui_viewport, ao_app);