# HG changeset patch # User Santeri Piippo # Date 1372961359 -10800 # Node ID 9dd47cc12ab83119d9e339d13192435217de04fb # Parent 30c11cff511d2c04ca3f98f49c43c08eadd00b04 fixed: overlays coudln't be defined for other cameras than the one used currently diff -r 30c11cff511d -r 9dd47cc12ab8 changelog.txt --- a/changelog.txt Thu Jul 04 21:01:52 2013 +0300 +++ b/changelog.txt Thu Jul 04 21:09:19 2013 +0300 @@ -22,6 +22,7 @@ the no-response policy could be a bad thing. - Color selector is now twice as wide for easier color selection. - Fixed: Recent files should behave coherently now. +- Fixed: Overlays could only be defined for the current camera, changing the camera in the prompt didn't work. - Fixed: text editing did not trigger checks while setting LDraw path, removed the Configure button from the LDraw path config dialog, it's no longer needed. - Fixed: Coordinates weren't drawn properly on a bright background (was always drawn in bright colors..). diff -r 30c11cff511d -r 9dd47cc12ab8 src/gldraw.cpp --- a/src/gldraw.cpp Thu Jul 04 21:01:52 2013 +0300 +++ b/src/gldraw.cpp Thu Jul 04 21:09:19 2013 +0300 @@ -1391,8 +1391,11 @@ } // ============================================================================= -Axis GLRenderer::cameraAxis (bool y) { - const staticCameraMeta* cam = &g_staticCameras[m_camera]; +Axis GLRenderer::cameraAxis (bool y, GL::Camera camid) { + if( camid == (GL::Camera) -1 ) + camid = m_camera; + + const staticCameraMeta* cam = &g_staticCameras[camid]; return (y) ? cam->axisY : cam->axisX; } @@ -1423,11 +1426,11 @@ elif( info.lh == 0 ) info.lh = ( info.lw * img->height() ) / img->width(); - const Axis x2d = cameraAxis( false ), - y2d = cameraAxis( true ); + const Axis x2d = cameraAxis( false, cam ), + y2d = cameraAxis( true, cam ); - double negXFac = g_staticCameras[m_camera].negX ? -1 : 1, - negYFac = g_staticCameras[m_camera].negY ? -1 : 1; + double negXFac = g_staticCameras[cam].negX ? -1 : 1, + negYFac = g_staticCameras[cam].negY ? -1 : 1; info.v0 = info.v1 = g_origin; info.v0[x2d] = -( info.ox * info.lw * negXFac ) / img->width(); diff -r 30c11cff511d -r 9dd47cc12ab8 src/gldraw.h --- a/src/gldraw.h Thu Jul 04 21:01:52 2013 +0300 +++ b/src/gldraw.h Thu Jul 04 21:09:19 2013 +0300 @@ -71,7 +71,7 @@ ~GLRenderer (); Camera camera () const { return m_camera; } - Axis cameraAxis (bool y); + Axis cameraAxis ( bool y, Camera camid = (Camera) -1 ); const char* cameraName () const; void clearOverlay (); void compileObject (LDObject* obj);