Changeset View
Changeset View
Standalone View
Standalone View
klineal.cpp
Show First 20 Lines • Show All 386 Lines • ▼ Show 20 Line(s) | 386 | { | |||
---|---|---|---|---|---|
387 | mLeftToRight = !mLeftToRight; | 387 | mLeftToRight = !mLeftToRight; | ||
388 | updateScaleDirectionMenuItem(); | 388 | updateScaleDirectionMenuItem(); | ||
389 | repaint(); | 389 | repaint(); | ||
390 | saveSettings(); | 390 | saveSettings(); | ||
391 | } | 391 | } | ||
392 | 392 | | |||
393 | void KLineal::centerOrigin() | 393 | void KLineal::centerOrigin() | ||
394 | { | 394 | { | ||
395 | mOffset = -( length() / 2 ); | 395 | int centerOffset = -length() / 2; | ||
396 | if (mOffset == centerOffset) { | ||||
397 | // centered already, go back to normal | ||||
398 | mOffset = 0; | ||||
399 | } else { | ||||
400 | mOffset = centerOffset; | ||||
401 | } | ||||
396 | repaint(); | 402 | repaint(); | ||
397 | saveSettings(); | 403 | saveSettings(); | ||
398 | } | 404 | } | ||
399 | 405 | | |||
400 | void KLineal::slotOffset() | 406 | void KLineal::slotOffset() | ||
401 | { | 407 | { | ||
402 | bool ok; | 408 | bool ok; | ||
403 | int newOffset = QInputDialog::getInt( this, i18nc( "@title:window", "Scale Offset" ), | 409 | int newOffset = QInputDialog::getInt( this, i18nc( "@title:window", "Scale Offset" ), | ||
▲ Show 20 Lines • Show All 536 Lines • Show Last 20 Lines |