]> Shamusworld >> Repos - ttedit/commitdiff
Minor changes: Supply a reasonable default epsilon to vector::zero() and
authorShamus Hammons <jlhamm@acm.org>
Fri, 27 Mar 2009 02:35:58 +0000 (02:35 +0000)
committerShamus Hammons <jlhamm@acm.org>
Fri, 27 Mar 2009 02:35:58 +0000 (02:35 +0000)
make char win draw solid black representation of outlines in main edit
window.

Makefile
src/charwindow.cpp
src/vector.cpp
src/vector.h

index baaff9389cd8aa3416d63662f3bb860e1c10f2be..d869379328dbc32f37eab0040821c1e9d3d2a6e6 100755 (executable)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 #############################################################################
 # Makefile for building: ttedit
-# Generated by qmake (2.01a) (Qt 4.5.0) on: Thu Mar 19 15:27:43 2009
+# Generated by qmake (2.01a) (Qt 4.5.0) on: Tue Mar 24 12:51:09 2009
 # Project:  ttedit.pro
 # Template: app
 # Command: /usr/bin/qmake -unix -o Makefile ttedit.pro
@@ -11,8 +11,8 @@
 CC            = gcc
 CXX           = g++
 DEFINES       = -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED
-CFLAGS        = -pipe -O2 -march=pentium-m -pipe -D_REENTRANT -Wall -W $(DEFINES)
-CXXFLAGS      = -pipe -O2 -march=pentium-m -pipe -D_REENTRANT -Wall -W $(DEFINES)
+CFLAGS        = -pipe -O2 -pipe -march=athlon -D_REENTRANT -Wall -W $(DEFINES)
+CXXFLAGS      = -pipe -O2 -pipe -march=athlon -D_REENTRANT -Wall -W $(DEFINES)
 INCPATH       = -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -Iobj -Iobj
 LINK          = g++
 LFLAGS        = -Wl,--as-needed
index 95965d4d60f2f5810d5974c8b6e37fcdde7fd155..769c20fe8ff4c52f28bee76a3d1760cba3b03e49 100755 (executable)
@@ -145,9 +145,9 @@ void CharWindow::paintEvent(QPaintEvent * /*event*/)
 
        QPainter p(this);
 
-       p.setBrush(QColor(122, 163, 39));
-// Need to translate as well...
-//     p.scale(2.0, 2.0);
+       p.setPen(QPen(Qt::black, 1.0, Qt::SolidLine));
+//     p.setBrush(QColor(122, 163, 39));
+       p.setBrush(Qt::black);
 
 /*
 1.0 -> 3.0, height = 400
@@ -176,8 +176,6 @@ conv.fac. -> (ps.h / r.h)
        {
                // height is limiting factor
                p.scale(yConvFac, -yConvFac);
-//extraX = (rect.height() / (float)paintSize.height()) * (float)paintSize.width();
-//extraX = (extraX - rect.width()) / 2.0f;
                extraX = (((float)paintSize.width() / yConvFac) - rect.width()) / 2.0f;
        }
        else
index 7458193e23dc9c8bed39cdbe9cfd2b52396e291e..32fe4e1cb7f4e47046cf163827ad1260f195b9e4 100755 (executable)
@@ -128,7 +128,7 @@ vector vector::operator*(const double &d)           // Scale vector by amount
        return vector(x * d, y * d, z * d);
 }
 
-void vector::zero(const double epsilon)
+void vector::zero(const double epsilon/*= 1.0e-6*/)
 {
        if (fabs(x) < epsilon)
                x = 0.0;
index 6f6fa06f1b7cda0fcb67ef2a6b5e2cfd03718e82..36025b9c075c44f8103219d2085ad436a97e5a04 100755 (executable)
@@ -29,7 +29,7 @@ struct vector
        void operator+=(const vector &v);
        void operator-=(const vector &v);
        vector operator*(const double &d);                      // Scale vector by amount
-       void zero(const double epsilon);
+       void zero(const double epsilon = 1.0e-6);
 };
 
 #endif // __VECTOR_H__