Added logic to increase size of sprite preview area.

This commit is contained in:
mjbudd77 2021-04-17 07:11:29 -04:00
parent 838ba76284
commit a09121b28d
2 changed files with 10 additions and 10 deletions

View File

@ -2761,7 +2761,7 @@ spriteViewerDialog_t::spriteViewerDialog_t(QWidget *parent)
previewAnimation = new QPropertyAnimation( previewFrame, "maximumWidth", this);
previewAnimation->setDuration(500);
previewAnimation->setStartValue(0);
previewAnimation->setEndValue(512);
previewAnimation->setEndValue(600);
previewAnimation->setEasingCurve( QEasingCurve::InOutCirc );
connect( previewAnimation, SIGNAL(valueChanged(const QVariant &)), this, SLOT(previewAnimWidthChange(const QVariant &)));
@ -2814,18 +2814,10 @@ void spriteViewerDialog_t::toggleGridVis(void)
//----------------------------------------------------
void spriteViewerDialog_t::togglePreviewVis(bool state)
{
//if ( previewFrame->isHidden() )
//{
// previewFrame->show();
//}
//else
//{
// previewFrame->hide();
//}
if ( state )
{
previewAnimation->setStartValue(0);
previewAnimation->setEndValue(512);
previewAnimation->setEndValue(600);
previewAnimation->start();
}
else
@ -3367,6 +3359,11 @@ int oamPreview_t::heightForWidth(int w) const
return ((w*256)/240);
}
//----------------------------------------------------
QSize oamPreview_t::sizeHint(void) const
{
return QSize(512,480);
}
//----------------------------------------------------
void oamPreview_t::resizeEvent(QResizeEvent *event)
{
viewWidth = event->size().width();
@ -3387,6 +3384,8 @@ void oamPreview_t::paintEvent(QPaintEvent *event)
viewWidth = event->rect().width();
viewHeight = event->rect().height();
//printf("Draw: %i,%i\n", viewWidth, viewHeight );
w = viewWidth / 256;
h = viewHeight / 240;

View File

@ -408,6 +408,7 @@ class oamPreview_t : public QWidget
void paintEvent(QPaintEvent *event);
void resizeEvent(QResizeEvent *event);
int heightForWidth(int w) const;
QSize sizeHint(void) const;
private:
int viewWidth;