Skip to content

Bug in mpFX x-range calculations causes out-of-range GetY calls #41

@DRNadler

Description

@DRNadler

I'm trying to graph a time-series with valid indices ~[0-165000].
mpFX correctly sets up m_bound from my GetMinX()/GetMaxX() functions.
But mpFX::DoPlot is indexing before the series (calls GetY with negative x) here:
// Get first point
iylast = w.y2p(DoGetY(w.p2x(m_plotBoundaries.startPx)), m_UseY2Axis);
startPx is set wrong, because m_posX is set to a negative value.
I think this happens because the x scaling factor is computed differently then this line in mpWindow::Fit():
m_posX = (rect.Xmin + rect.Xmax) / 2 - (m_plotWidth / 2 + m_margin.left) / m_scaleX;
Perhaps m_scaleX is computed without the margin?
This may do with the fix introduced here by JL.
Thoughts?
PS: Also indexing past the end of the series several times.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions