Nothing helped
void Scale::changedScale()
{
// Zoom scale
// if(qFuzzyCompare(m_cbScale->currentText().toDouble(), 600.0)) {
// m_screen->zoom(QwtPointPolar(0, 0), MAX_DISPLAY_FACTOR);
// } else {
// m_screen->zoom(m_screen->zoomPos(), m_cbScale->currentText().toDouble() / 600.0);
// }
// Azimuth scale
m_screen->setScale(QwtPolar::Azimuth, 360, 0, m_cbAzimuth->currentText().toDouble());
// Distance scale
m_scaleDiv.setLowerBound(0);
m_scaleDiv.setUpperBound(m_cbScale->currentText().toDouble());
m_scaleDiv.
setTicks(QwtScaleDiv::MinorTick, getTicks
(m_cbDistance
->currentText
().
toDouble()));
m_scaleDiv.
setTicks(QwtScaleDiv::MediumTick, getTicks
(m_cbDistance
->currentText
().
toDouble()));
m_scaleDiv.
setTicks(QwtScaleDiv::MajorTick, getTicks
(m_cbDistance
->currentText
().
toDouble()));
m_screen->setScaleDiv(QwtPolar::Radius, m_scaleDiv);
m_screen->setScale(QwtPolar::Radius, 0, m_cbScale->currentText().toDouble());
m_screen->replot();
}
QList<double> Scale::getTicks(double step) const
{
QList<double> ticks;
if(qFuzzyCompare(step, 0)) {
return ticks;
}
for(double i = 0; i <= m_cbScale->currentText().toDouble(); i += step) {
ticks.append(i);
}
return ticks;
}
void Scale::changedScale()
{
// Zoom scale
// if(qFuzzyCompare(m_cbScale->currentText().toDouble(), 600.0)) {
// m_screen->zoom(QwtPointPolar(0, 0), MAX_DISPLAY_FACTOR);
// } else {
// m_screen->zoom(m_screen->zoomPos(), m_cbScale->currentText().toDouble() / 600.0);
// }
// Azimuth scale
m_screen->setScale(QwtPolar::Azimuth, 360, 0, m_cbAzimuth->currentText().toDouble());
// Distance scale
m_scaleDiv.setLowerBound(0);
m_scaleDiv.setUpperBound(m_cbScale->currentText().toDouble());
m_scaleDiv.setTicks(QwtScaleDiv::MinorTick, getTicks(m_cbDistance->currentText().toDouble()));
m_scaleDiv.setTicks(QwtScaleDiv::MediumTick, getTicks(m_cbDistance->currentText().toDouble()));
m_scaleDiv.setTicks(QwtScaleDiv::MajorTick, getTicks(m_cbDistance->currentText().toDouble()));
m_screen->setScaleDiv(QwtPolar::Radius, m_scaleDiv);
m_screen->setScale(QwtPolar::Radius, 0, m_cbScale->currentText().toDouble());
m_screen->replot();
}
QList<double> Scale::getTicks(double step) const
{
QList<double> ticks;
if(qFuzzyCompare(step, 0)) {
return ticks;
}
for(double i = 0; i <= m_cbScale->currentText().toDouble(); i += step) {
ticks.append(i);
}
return ticks;
}
To copy to clipboard, switch view to plain text mode
void Scale::changedScale()
{
// Azimuth scale
m_screen->setScale(QwtPolar::Azimuth, 360, 0, m_cbAzimuth->currentText().toDouble());
// Distance scale
m_screen->setScale(QwtPolar::Radius, 0, 600.0);
double maxMajor = 600.0 / m_cbDistance->currentText().toDouble();
m_screen->setScaleMaxMajor(QwtPolar::Radius,
qFuzzyCompare(maxMajor, static_cast<int>(maxMajor))
? maxMajor : maxMajor + 1);
// Zoom scale <-- This spoils everything!!!
if(qFuzzyCompare(m_cbScale->currentText().toDouble(), 600.0)) {
m_screen->zoom(QwtPointPolar(0, 0), MAX_DISPLAY_FACTOR);
} else {
m_screen->zoom(m_screen->zoomPos(), m_cbScale->currentText().toDouble() / 600.0);
}
m_screen->replot();
}
void Scale::changedScale()
{
// Azimuth scale
m_screen->setScale(QwtPolar::Azimuth, 360, 0, m_cbAzimuth->currentText().toDouble());
// Distance scale
m_screen->setScale(QwtPolar::Radius, 0, 600.0);
double maxMajor = 600.0 / m_cbDistance->currentText().toDouble();
m_screen->setScaleMaxMajor(QwtPolar::Radius,
qFuzzyCompare(maxMajor, static_cast<int>(maxMajor))
? maxMajor : maxMajor + 1);
// Zoom scale <-- This spoils everything!!!
if(qFuzzyCompare(m_cbScale->currentText().toDouble(), 600.0)) {
m_screen->zoom(QwtPointPolar(0, 0), MAX_DISPLAY_FACTOR);
} else {
m_screen->zoom(m_screen->zoomPos(), m_cbScale->currentText().toDouble() / 600.0);
}
m_screen->replot();
}
To copy to clipboard, switch view to plain text mode
Bookmarks