X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Feditwindow.cpp;h=dac63c28c736d5d3b2cf8bb8d9e8f151684bccec;hb=c7d608c4fcdd370274964cc861b674c2fae69468;hp=d24c447ab6b279bdab42760a7c804c6c61a748b8;hpb=0bd89e9489fa52f92545a7e94c4a31e863a5f898;p=ttedit diff --git a/src/editwindow.cpp b/src/editwindow.cpp index d24c447..dac63c2 100644 --- a/src/editwindow.cpp +++ b/src/editwindow.cpp @@ -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(); }