]> Shamusworld >> Repos - ttedit/blobdiff - src/editwindow.cpp
Added preview window to file loading dialog. :-)
[ttedit] / src / editwindow.cpp
index d24c447ab6b279bdab42760a7c804c6c61a748b8..dac63c28c736d5d3b2cf8bb8d9e8f151684bccec 100644 (file)
@@ -38,6 +38,7 @@
 #include "debug.h"
 #include "global.h"
 #include "mainwindow.h"
+#include "mathconstants.h"
 #include "ttedit.h"
 #include "vector.h"
 
@@ -581,8 +582,9 @@ void EditWindow::mouseMoveEvent(QMouseEvent * event)
                                }
                                else
                                {
-                                       // Figure out the angle between the "zero" vector and the current one,
-                                       // then rotate all points relative to the "zero" vector (done by paint())
+                                       // Figure out the angle between the "zero" vector and the
+                                       // current one, then rotate all points relative to the
+                                       // "zero" vector (done by paint())
 //                                     QPoint currentPoint = GetAdjustedMousePosition(event);
                                        Vector currentPoint = Painter::QtToCartesianCoords(Vector(event->x(), event->y()));
                                        Vector v1(rotationZeroPoint.x, rotationZeroPoint.y, 0,
@@ -593,8 +595,8 @@ void EditWindow::mouseMoveEvent(QMouseEvent * event)
                                        rotationAngle = v2.Angle(v1);
 
                                        QString s;
-                                       s.sprintf("%.3f degrees", rotationAngle * 180.0 / 3.14159265358979323);
-                                       ((TTEdit *)qApp)->mainWindow->statusBar()->showMessage(s);
+                                       s.sprintf("%.3f degrees", rotationAngle * RADIANS_TO_DEGREES);
+                                       Global::mainWindow->statusBar()->showMessage(s);
                                }
 
                                update();
@@ -776,14 +778,14 @@ void EditWindow::mouseReleaseEvent(QMouseEvent * event)
                        }
 
                        update();
-                       ((TTEdit *)qApp)->mainWindow->statusBar()->showMessage("");
+                       Global::mainWindow->statusBar()->showMessage("");
                }
 
 //             if (tool == TOOLScroll || tool == TOOLZoom)
 //                     ReleaseMouse();
 //this is prolly too much
-               ((TTEdit *)qApp)->charWnd->MakePathFromPoints(&pts);
-               ((TTEdit *)qApp)->charWnd->update();
+               Global::charWnd->MakePathFromPoints(&pts);
+               Global::charWnd->update();
 
                if (tool == TOOLMultiSelect)
                {
@@ -849,8 +851,8 @@ void EditWindow::keyPressEvent(QKeyEvent * event)
 //Not need but you need to call the base class for some reason??
 //     event->accept();
        update();
-       ((TTEdit *)qApp)->charWnd->MakePathFromPoints(&pts);
-       ((TTEdit *)qApp)->charWnd->update();
+       Global::charWnd->MakePathFromPoints(&pts);
+       Global::charWnd->update();
 }