diff --git a/klineal.cpp b/klineal.cpp --- a/klineal.cpp +++ b/klineal.cpp @@ -392,7 +392,13 @@ void KLineal::centerOrigin() { - mOffset = -( length() / 2 ); + int centerOffset = -length() / 2; + if (mOffset == centerOffset) { + // centered already, go back to normal + mOffset = 0; + } else { + mOffset = centerOffset; + } repaint(); saveSettings(); }