Blake-Madden / Wisteria-Dataviz

Wisteria Dataviz Library
BSD 3-Clause "New" or "Revised" License
15 stars 3 forks source link

Asserts in sample in Point2D::Draw #15

Closed PBfordev closed 2 years ago

PBfordev commented 2 years ago

When running a sample and trying to show some charts (e.g., Line Plot or Linear Regression Roadmap), an assert is shown: D:\dev\Desktop\Lib\Wisteria-Dataviz-GIT\src\base\shapes.cpp(209): assert "m_drawFunction" failed in Wisteria::GraphItems::Shape::Draw(): Shape failed to set drawing function!

Call stack

    WisteriaDemo.exe!Wisteria::GraphItems::Shape::Draw(const wxRect & drawRect, wxDC & dc) Line 209 C++
    WisteriaDemo.exe!Wisteria::GraphItems::Shape::Draw(wxDC & dc) Line 86   C++
    WisteriaDemo.exe!Wisteria::GraphItems::Point2D::Draw(wxDC & dc) Line 322    C++
    WisteriaDemo.exe!Wisteria::GraphItems::Points2D::Draw(wxDC & dc) Line 285   C++
    WisteriaDemo.exe!Wisteria::Graphs::Graph2D::Draw(wxDC & dc) Line 867    C++
    WisteriaDemo.exe!Wisteria::Canvas::OnDraw(wxDC & dc) Line 1311  C++

It seems that m_drawFunction is null because m_shape is Blank but as I am not familiar with code I do not know whether the problem is that the m_drawFunction is null when it should not be or whether the assert should take m_shape being Blank into account.

Windows 10 v19044.1889, wxWidgets GIT master built 64-bit Debug Static, both displays set at 125% DPI.

Sorry for flooding the repo with issues, I have not even really tried the library, as I always fail with some issue like this.

Blake-Madden commented 2 years ago

Corrected the assert for blank shapes, all samples are working again. Thanks!