mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-27 14:48:46 -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
13
plotter.cpp
13
plotter.cpp
@ -195,10 +195,12 @@ 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 );
|
||||
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);
|
||||
@ -208,8 +210,7 @@ void CPlotter::DrawOverlay() //DrawOverlay()
|
||||
|
||||
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
|
||||
{
|
||||
for( int i=1; i<VERT_DIVS; i++) { //draw horizontal grids
|
||||
y = (int)( (float)i*pixperdiv );
|
||||
painter.drawLine(0, y, w, y);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user