-rw-r--r-- | core/apps/calibrate/calibrate.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/apps/calibrate/calibrate.cpp b/core/apps/calibrate/calibrate.cpp index 5f52bdc..53388f1 100644 --- a/core/apps/calibrate/calibrate.cpp +++ b/core/apps/calibrate/calibrate.cpp | |||
@@ -119,17 +119,17 @@ bool Calibrate::sanityCheck() | |||
119 | { | 119 | { |
120 | #ifdef QWS | 120 | #ifdef QWS |
121 | QPoint tl = cd.devPoints[QWSPointerCalibrationData::TopLeft]; | 121 | QPoint tl = cd.devPoints[QWSPointerCalibrationData::TopLeft]; |
122 | QPoint tr = cd.devPoints[QWSPointerCalibrationData::TopRight]; | 122 | QPoint tr = cd.devPoints[QWSPointerCalibrationData::TopRight]; |
123 | QPoint bl = cd.devPoints[QWSPointerCalibrationData::BottomLeft]; | 123 | QPoint bl = cd.devPoints[QWSPointerCalibrationData::BottomLeft]; |
124 | QPoint br = cd.devPoints[QWSPointerCalibrationData::BottomRight]; | 124 | QPoint br = cd.devPoints[QWSPointerCalibrationData::BottomRight]; |
125 | 125 | ||
126 | // not needed anywhere .. just calculate it, so it's there | 126 | // not needed anywhere .. just calculate it, so it's there |
127 | cd.devPoints[QWSPointerCalibrationData::Center] = QRect( tl, br ).normalize().center(); | 127 | //cd.devPoints[QWSPointerCalibrationData::Center] = QRect( tl, br ).normalize().center(); |
128 | 128 | ||
129 | int dlx = QABS( bl. x ( ) - tl. x ( )); | 129 | int dlx = QABS( bl. x ( ) - tl. x ( )); |
130 | int dly = QABS( bl. y ( ) - tl. y ( )); | 130 | int dly = QABS( bl. y ( ) - tl. y ( )); |
131 | int drx = QABS( br. x ( ) - tr. x ( )); | 131 | int drx = QABS( br. x ( ) - tr. x ( )); |
132 | int dry = QABS( br. y ( ) - tr. y ( )); | 132 | int dry = QABS( br. y ( ) - tr. y ( )); |
133 | int dtx = QABS( tr. x ( ) - tl. x ( )); | 133 | int dtx = QABS( tr. x ( ) - tl. x ( )); |
134 | int dty = QABS( tr. y ( ) - tl. y ( )); | 134 | int dty = QABS( tr. y ( ) - tl. y ( )); |
135 | int dbx = QABS( br. x ( ) - bl. x ( )); | 135 | int dbx = QABS( br. x ( ) - bl. x ( )); |
@@ -170,17 +170,17 @@ void Calibrate::moveCrosshair( QPoint pt ) | |||
170 | showCross = TRUE; | 170 | showCross = TRUE; |
171 | crossPos = pt; | 171 | crossPos = pt; |
172 | repaint( crossPos.x() - 14, crossPos.y() - 14, 28, 28 ); | 172 | repaint( crossPos.x() - 14, crossPos.y() - 14, 28, 28 ); |
173 | } | 173 | } |
174 | 174 | ||
175 | void Calibrate::paintEvent( QPaintEvent * ) | 175 | void Calibrate::paintEvent( QPaintEvent * ) |
176 | { | 176 | { |
177 | QPainter p( this ); | 177 | QPainter p( this ); |
178 | int y = height() / 3; | 178 | int y = height() / 2; |
179 | 179 | ||
180 | p.drawText( 0, y + height() / 8, width(), height() - y, AlignHCenter, | 180 | p.drawText( 0, y + height() / 8, width(), height() - y, AlignHCenter, |
181 | tr( "Touch the crosshairs firmly and\n" | 181 | tr( "Touch the crosshairs firmly and\n" |
182 | "accurately to calibrate your screen." ) ); | 182 | "accurately to calibrate your screen." ) ); |
183 | 183 | ||
184 | if ( !showCross ) return; | 184 | if ( !showCross ) return; |
185 | 185 | ||
186 | #if 0 | 186 | #if 0 |
@@ -218,17 +218,17 @@ void Calibrate::mouseReleaseEvent( QMouseEvent * ) | |||
218 | { | 218 | { |
219 | #ifdef QWS | 219 | #ifdef QWS |
220 | if ( timer->isActive() ) | 220 | if ( timer->isActive() ) |
221 | return ; | 221 | return ; |
222 | 222 | ||
223 | bool doMove = TRUE; | 223 | bool doMove = TRUE; |
224 | 224 | ||
225 | cd.devPoints[ location ] = penPos; | 225 | cd.devPoints[ location ] = penPos; |
226 | if ( location < QWSPointerCalibrationData::TopRight ) { | 226 | if ( location < QWSPointerCalibrationData::Center ) { |
227 | location = (QWSPointerCalibrationData::Location) ( int( location ) + 1 ); | 227 | location = (QWSPointerCalibrationData::Location) ( int( location ) + 1 ); |
228 | } | 228 | } |
229 | else { | 229 | else { |
230 | if ( sanityCheck() ) { | 230 | if ( sanityCheck() ) { |
231 | reset(); | 231 | reset(); |
232 | goodcd = cd; | 232 | goodcd = cd; |
233 | hide(); | 233 | hide(); |
234 | emit accept(); | 234 | emit accept(); |