From b09482fd3d392222023130c82e79e33d35deb2f9 Mon Sep 17 00:00:00 2001 From: Paolo Cignoni cignoni Date: Sat, 1 Mar 2008 10:30:25 +0000 Subject: [PATCH] - fixed xQuality label bug --- src/fgt/edit_quality/qualitymapperdialog.cpp | 9 +++------ src/fgt/edit_quality/qualitymapperdialog.h | 4 ++-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/fgt/edit_quality/qualitymapperdialog.cpp b/src/fgt/edit_quality/qualitymapperdialog.cpp index ce90da942..68f5f2546 100644 --- a/src/fgt/edit_quality/qualitymapperdialog.cpp +++ b/src/fgt/edit_quality/qualitymapperdialog.cpp @@ -1271,14 +1271,11 @@ void QualityMapperDialog::updateXQualityLabel(float xPos) _currentTfHandleQualityValue.setNum(relative2QualityValf(xPos, ui.minSpinBox->value(), ui.maxSpinBox->value(), exp)); if (_currentTfHandleQualityValue.size() < QUALITY_LABEL_DIGITS_NUM) { - int pos = 0; QChar paddedZeros[] = {'0','0','0','0','0','0'}; - if((pos = _currentTfHandleQualityValue.indexOf('.')) == -1) - { + if(_currentTfHandleQualityValue.indexOf('.') == -1) _currentTfHandleQualityValue.append('.'); - pos = _currentTfHandleQualityValue.size() - 1; - } - _currentTfHandleQualityValue.insert(pos, paddedZeros, QUALITY_LABEL_DIGITS_NUM-_currentTfHandleQualityValue.size()); + if ((QUALITY_LABEL_DIGITS_NUM - _currentTfHandleQualityValue.size()) > 0) + _currentTfHandleQualityValue.insert(_currentTfHandleQualityValue.size(), paddedZeros, QUALITY_LABEL_DIGITS_NUM-_currentTfHandleQualityValue.size()); } ui.xQualityLabel->setText(_currentTfHandleQualityValue); } diff --git a/src/fgt/edit_quality/qualitymapperdialog.h b/src/fgt/edit_quality/qualitymapperdialog.h index 92241e60f..a0d154cba 100644 --- a/src/fgt/edit_quality/qualitymapperdialog.h +++ b/src/fgt/edit_quality/qualitymapperdialog.h @@ -27,8 +27,8 @@ FIRST RELEASE ****************************************************************************/ -#ifndef QUALITYMAPPERDIALOG_H -#define QUALITYMAPPERDIALOG_H +#ifndef _QUALITYMAPPER_DIALOG_H_ +#define _QUALITYMAPPER_DIALOG_H_ #include #include