From 9e6454a798ebe1639949914681ad6d599da05386 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Tue, 1 Jun 2010 03:21:14 +0000 Subject: [PATCH] Fix a few spots where x and y were swapped in the X/Y rotation tool. Originally committed to SVN as r4386. --- aegisub/src/visual_tool_rotatexy.cpp | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/aegisub/src/visual_tool_rotatexy.cpp b/aegisub/src/visual_tool_rotatexy.cpp index fdfdd8b9a..9b3909367 100644 --- a/aegisub/src/visual_tool_rotatexy.cpp +++ b/aegisub/src/visual_tool_rotatexy.cpp @@ -169,8 +169,8 @@ void VisualToolRotateXY::Draw() { bool VisualToolRotateXY::InitializeHold() { GetLinePosition(curDiag,odx,ody,orgx,orgy); GetLineRotation(curDiag,origAngleX,origAngleY,rz); - startAngleX = (orgy-video.x)*2.0; - startAngleY = (video.y-orgx)*2.0; + startAngleX = (orgy-video.y)*2.f; + startAngleY = (video.x-orgx)*2.f; curAngleX = origAngleX; curAngleY = origAngleY; curDiag->StripTag(L"\\frx"); @@ -181,28 +181,27 @@ bool VisualToolRotateXY::InitializeHold() { /// @brief Update hold void VisualToolRotateXY::UpdateHold() { - // Find screen angles - float screenAngleX = (orgy-video.x)*2.0; - float screenAngleY = (video.y-orgx)*2.0; + float screenAngleX = (orgy-video.y)*2.f; + float screenAngleY = (video.x-orgx)*2.f; // Deltas float deltaX = screenAngleX - startAngleX; float deltaY = screenAngleY - startAngleY; if (shiftDown) { - if (fabs(deltaX) >= fabs(deltaY)) deltaY = 0; - else deltaX = 0; + if (fabs(deltaX) >= fabs(deltaY)) deltaY = 0.f; + else deltaX = 0.f; } // Calculate - curAngleX = fmodf(deltaX + origAngleX + 360., 360.); - curAngleY = fmodf(deltaY + origAngleY + 360., 360.); + curAngleX = fmodf(deltaX + origAngleX + 360.f, 360.f); + curAngleY = fmodf(deltaY + origAngleY + 360.f, 360.f); // Oh Snap if (ctrlDown) { - curAngleX = floorf(curAngleX/30.f+.5f)*30.0f; - curAngleY = floorf(curAngleY/30.f+.5f)*30.0f; - if (curAngleX > 359.0f) curAngleX = 0.0f; - if (curAngleY > 359.0f) curAngleY = 0.0f; + curAngleX = floorf(curAngleX/30.f+.5f)*30.f; + curAngleY = floorf(curAngleY/30.f+.5f)*30.f; + if (curAngleX > 359.f) curAngleX = 0.f; + if (curAngleY > 359.f) curAngleY = 0.f; } }