summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/settings/light-and-power/calibration.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/core/settings/light-and-power/calibration.cpp b/core/settings/light-and-power/calibration.cpp
index aed2bc8..c5377d0 100644
--- a/core/settings/light-and-power/calibration.cpp
+++ b/core/settings/light-and-power/calibration.cpp
@@ -141,4 +141,4 @@ void Calibration::checkPoints ( )
m_p [0]. setY ( 0 );
- if ( m_p [0]. y ( ) > m_p [1]. y ( ))
- m_p [0]. setY ( m_p [1]. y ( ));
+ if ( m_p [0]. y ( ) >= dy )
+ m_p [0]. setY ( dy - 1 );
}
@@ -207,4 +207,4 @@ void Calibration::mouseMoveEvent ( QMouseEvent *e )
n [m_dragged]. setY ( m_scale. height ( ) - 1 );
- if ( n [0]. y ( ) > n [1]. y ( ))
- n [m_dragged]. setY ( n [1 - m_dragged]. y ( ));
+// if ( n [0]. y ( ) > n [1]. y ( ))
+// n [m_dragged]. setY ( n [1 - m_dragged]. y ( ));
@@ -239,4 +239,4 @@ void Calibration::mouseMoveEvent ( QMouseEvent *e )
if ( r. isValid ( )) {
- r |= QRect ( nx [0], ny [0], nx [1] - nx [0] + 1, ny [1] - ny [0] + 1 );
- r |= QRect ( ox [0], oy [0], ox [1] - ox [0] + 1, oy [1] - oy [0] + 1 );
+ r |= QRect ( nx [0], ny [0], nx [1] - nx [0] + 1, ny [1] - ny [0] + 1 ). normalize ( );
+ r |= QRect ( ox [0], oy [0], ox [1] - ox [0] + 1, oy [1] - oy [0] + 1 ). normalize ( );
@@ -276,3 +276,3 @@ void Calibration::paintEvent ( QPaintEvent *pe )
// restrict steps to real x and y resolution
- int st = QMIN( QMIN( m_steps, ( dx + 1 )), ( dy + 1 ));
+ int st = QMIN( QMIN( m_steps, ( dx + 1 )), ( QABS( dy ) + 1 ));