The pResize() proc does not take into account the bar visibility when calculating how many bars are below the current bar (iBelow).
Solution: loop and count the number of VISIBLE bars are the current one:
iAbove = m_iSelBar
' original code:
'iBelow = m_iBarCount - m_iSelBar
' modified code:
For i = m_iBarCount To (m_iSelBar + 1) Step -1
If m_tBar(i).bVisible Then
iBelow = iBelow + 1
End If
Next
|