mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-12-17 16:38:20 -05:00
Correct the placement of vertical grid lines when start freq is nonzero.
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@4717 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
ed6b6143cf
commit
11d8b17733
29
plotter.cpp
29
plotter.cpp
@ -195,24 +195,25 @@ void CPlotter::DrawOverlay() //DrawOverlay()
|
||||
|
||||
pixperdiv = m_freqPerDiv/df;
|
||||
y = m_h2 - m_h2/VERT_DIVS;
|
||||
m_hdivs = w*df/m_freqPerDiv + 0.9999;
|
||||
for( int i=1; i<m_hdivs; i++) //draw vertical grids
|
||||
{
|
||||
x = (int)( (float)i*pixperdiv );
|
||||
if(x >= 0 and x<=m_w) {
|
||||
painter.setPen(QPen(Qt::white, 1,Qt::DotLine));
|
||||
painter.drawLine(x, 0, x , y);
|
||||
painter.drawLine(x, m_h2-5, x , m_h2);
|
||||
}
|
||||
m_hdivs = w*df/m_freqPerDiv + 1.9999;
|
||||
float xx0=float(m_startFreq)/float(m_freqPerDiv);
|
||||
xx0=xx0-int(xx0);
|
||||
int x0=xx0*pixperdiv+0.5;
|
||||
for( int i=1; i<m_hdivs; i++) { //draw vertical grids
|
||||
x = (int)((float)i*pixperdiv ) - x0;
|
||||
if(x >= 0 and x<=m_w) {
|
||||
painter.setPen(QPen(Qt::white, 1,Qt::DotLine));
|
||||
painter.drawLine(x, 0, x , y);
|
||||
painter.drawLine(x, m_h2-5, x , m_h2);
|
||||
}
|
||||
}
|
||||
|
||||
pixperdiv = (float)m_h2 / (float)VERT_DIVS;
|
||||
painter.setPen(QPen(Qt::white, 1,Qt::DotLine));
|
||||
for( int i=1; i<VERT_DIVS; i++) //draw horizontal grids
|
||||
{
|
||||
y = (int)( (float)i*pixperdiv );
|
||||
painter.drawLine(0, y, w, y);
|
||||
}
|
||||
for( int i=1; i<VERT_DIVS; i++) { //draw horizontal grids
|
||||
y = (int)( (float)i*pixperdiv );
|
||||
painter.drawLine(0, y, w, y);
|
||||
}
|
||||
}
|
||||
|
||||
QRect rect0;
|
||||
|
Loading…
Reference in New Issue
Block a user