From c7f29699d3bc5b067adeb76ac347edea68d9bbba Mon Sep 17 00:00:00 2001 From: James Turner Date: Wed, 15 Mar 2017 11:58:47 +0000 Subject: [PATCH] Allow XML control over splash logo position. As suggested by Chris, these are normalised and account for the logo size after scaling, so 0.5 will centre, 1.0 is the right/bottom edge. E.g. (in /sim/startup) 0.5 0.9 Many values will overlap with other text, so use with care! --- src/Viewer/splash.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Viewer/splash.cxx b/src/Viewer/splash.cxx index 6e6367c7e..8b363fc5f 100644 --- a/src/Viewer/splash.cxx +++ b/src/Viewer/splash.cxx @@ -614,8 +614,13 @@ void SplashScreen::resize( int width, int height ) if (_aircraftLogoVertexArray) { float logoWidth = fgGetDouble("/sim/startup/splash-logo-width", 0.6) * width; float logoHeight = _logoImage->t() * (logoWidth / _logoImage->s()); - float originX = width * -0.5; - float originY = height * ((1.0 - 0.935) - 0.5); + + float logoX = fgGetDouble("/sim/startup/splash-logo-x-norm", 0.0) * (width - logoWidth); + float logoY = fgGetDouble("/sim/startup/splash-logo-y-norm", 1.0 - 0.935) * (height - logoHeight); + + float originX = logoX - (width * 0.5); + float originY = logoY - (height * 0.5); + osg::Vec3 positions[4] = { osg::Vec3(originX, originY, 0.0), osg::Vec3(originX + logoWidth, originY, 0.0),