From 92fbec47c21609261729e48e75ba4c997ee02c0e Mon Sep 17 00:00:00 2001 From: pjft Date: Fri, 7 Jul 2017 20:48:50 +0100 Subject: [PATCH] Fix for lack of zoom transition on video view for systems without marquees --- .../src/views/gamelist/VideoGameListView.cpp | 29 +++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/es-app/src/views/gamelist/VideoGameListView.cpp b/es-app/src/views/gamelist/VideoGameListView.cpp index 09c6bbe7c..ec139b0fb 100644 --- a/es-app/src/views/gamelist/VideoGameListView.cpp +++ b/es-app/src/views/gamelist/VideoGameListView.cpp @@ -320,9 +320,34 @@ void VideoGameListView::updateInfoPanel() void VideoGameListView::launch(FileData* game) { - Eigen::Vector3f target(Renderer::getScreenWidth() / 2.0f, Renderer::getScreenHeight() / 2.0f, 0); - if(mMarquee.hasImage()) + float screenWidth = Renderer::getScreenWidth(); + float screenHeight = Renderer::getScreenHeight(); + + Eigen::Vector3f target(screenWidth / 2.0f, screenHeight / 2.0f, 0); + + if(mMarquee.hasImage() && + (mMarquee.getPosition().x() < screenWidth && mMarquee.getPosition().x() > 0.0f && + mMarquee.getPosition().y() < screenHeight && mMarquee.getPosition().y() > 0.0f)) + { + target << mMarquee.getCenter().x(), mMarquee.getCenter().y(), 0; + } + else if(mImage.hasImage() && + (mImage.getPosition().x() < screenWidth && mImage.getPosition().x() > 2.0f && + mImage.getPosition().y() < screenHeight && mImage.getPosition().y() > 2.0f)) + { + target << mImage.getCenter().x(), mImage.getCenter().y(), 0; + } + else if(mHeaderImage.hasImage() && + (mHeaderImage.getPosition().x() < screenWidth && mHeaderImage.getPosition().x() > 0.0f && + mHeaderImage.getPosition().y() < screenHeight && mHeaderImage.getPosition().y() > 0.0f)) + { + target << mHeaderImage.getCenter().x(), mHeaderImage.getCenter().y(), 0; + } + else if(mVideo->getPosition().x() < screenWidth && mVideo->getPosition().x() > 0.0f && + mVideo->getPosition().y() < screenHeight && mVideo->getPosition().y() > 0.0f) + { target << mVideo->getCenter().x(), mVideo->getCenter().y(), 0; + } ViewController::get()->launch(game, target); }