From 7169af5d07be6e496cef0ac88d0e13647041d198 Mon Sep 17 00:00:00 2001 From: Shamus Hammons Date: Fri, 27 Mar 2009 02:35:58 +0000 Subject: [PATCH] Minor changes: Supply a reasonable default epsilon to vector::zero() and make char win draw solid black representation of outlines in main edit window. --- Makefile | 6 +++--- src/charwindow.cpp | 8 +++----- src/vector.cpp | 2 +- src/vector.h | 2 +- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index baaff93..d869379 100755 --- 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 diff --git a/src/charwindow.cpp b/src/charwindow.cpp index 95965d4..769c20f 100755 --- a/src/charwindow.cpp +++ b/src/charwindow.cpp @@ -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 diff --git a/src/vector.cpp b/src/vector.cpp index 7458193..32fe4e1 100755 --- a/src/vector.cpp +++ b/src/vector.cpp @@ -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; diff --git a/src/vector.h b/src/vector.h index 6f6fa06..36025b9 100755 --- a/src/vector.h +++ b/src/vector.h @@ -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__ -- 2.37.2