Fixed detailed view launch animation targetting wrong point when game

image is not at origin 0.5 0.5.
Tweaked launch animation to zoom a little faster so that images that the
camera doesn't overstep the bounds of the UI when the image is closer to
the edge.
This commit is contained in:
Aloshi 2014-01-22 17:40:31 -06:00
parent dd0c37ac23
commit 305e91c9f8
2 changed files with 2 additions and 2 deletions

View file

@ -40,7 +40,7 @@ public:
{ {
cameraOut = Eigen::Affine3f::Identity(); cameraOut = Eigen::Affine3f::Identity();
float zoom = lerp<float>(1.0, 3.0, t*t); float zoom = lerp<float>(1.0, 4.25f, t*t);
cameraOut.scale(Eigen::Vector3f(zoom, zoom, 1)); cameraOut.scale(Eigen::Vector3f(zoom, zoom, 1));
const float sw = (float)Renderer::getScreenWidth() / zoom; const float sw = (float)Renderer::getScreenWidth() / zoom;

View file

@ -205,7 +205,7 @@ void DetailedGameListView::launch(FileData* game)
{ {
Eigen::Vector3f target(Renderer::getScreenWidth() / 2.0f, Renderer::getScreenHeight() / 2.0f, 0); Eigen::Vector3f target(Renderer::getScreenWidth() / 2.0f, Renderer::getScreenHeight() / 2.0f, 0);
if(mImage.hasImage()) if(mImage.hasImage())
target = mImage.getPosition(); target << mImage.getCenter().x(), mImage.getCenter().y(), 0;
mWindow->getViewController()->launch(game, target); mWindow->getViewController()->launch(game, target);
} }