From cc70f501c887a491b320ca63bd59294f2a509f2b Mon Sep 17 00:00:00 2001 From: Matthew Budd Date: Mon, 5 Oct 2020 19:35:14 -0400 Subject: [PATCH] Minor bugfix for pattern table label when mouse scroll out of bounds. --- src/drivers/Qt/ppuViewer.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/drivers/Qt/ppuViewer.cpp b/src/drivers/Qt/ppuViewer.cpp index 8ba27639..5bc9a629 100644 --- a/src/drivers/Qt/ppuViewer.cpp +++ b/src/drivers/Qt/ppuViewer.cpp @@ -96,10 +96,10 @@ ppuViewerDialog_t::ppuViewerDialog_t(QWidget *parent) sprite8x16Cbox[0]->setChecked( PPUView_sprite16Mode[0] ); sprite8x16Cbox[1]->setChecked( PPUView_sprite16Mode[1] ); - patternVbox[0]->addWidget( patternView[0], 10 ); + patternVbox[0]->addWidget( patternView[0], 100 ); patternVbox[0]->addWidget( tileLabel[0], 1 ); patternVbox[0]->addWidget( sprite8x16Cbox[0], 1 ); - patternVbox[1]->addWidget( patternView[1], 10 ); + patternVbox[1]->addWidget( patternView[1], 100 ); patternVbox[1]->addWidget( tileLabel[1], 1 ); patternVbox[1]->addWidget( sprite8x16Cbox[1], 1 ); @@ -300,12 +300,14 @@ void ppuPatternView_t::resizeEvent(QResizeEvent *event) //---------------------------------------------------- void ppuPatternView_t::mouseMoveEvent(QMouseEvent *event) { - char stmp[64]; QPoint tile = convPixToTile( event->pos() ); - sprintf( stmp, "Tile: $%X%X", tile.y(), tile.x() ); - - tileLabel->setText( tr(stmp) ); + if ( (tile.x() < 16) && (tile.y() < 16) ) + { + char stmp[64]; + sprintf( stmp, "Tile: $%X%X", tile.y(), tile.x() ); + tileLabel->setText( tr(stmp) ); + } } //---------------------------------------------------------------------------- void ppuPatternView_t::mousePressEvent(QMouseEvent * event)