Menu

#14 mpFXYVector bug when vector is outside the bounding box

v1.0 (example)
open
nobody
None
5
2023-10-13
2023-01-05
bouced
No

Hello
I found a bug with FXY when some breakpoints are outside the window, the shape is distorted.
Please find attached an example code drawing a diamond shape that you can move out of bounds and see the problem.
I will try to fix this issue.
Bests
Cedric

1 Attachments

Discussion

  • bouced

    bouced - 2023-01-08

    One solution is to remove the piece of code in charge of plotting only visible segments: lines 650 to 688 of mathplot.cpp@rev102 and just keep dc.DrawLine(x0, c0, x1, c1); and UpdateViewBoundary.
    The drawback of this solution is that it will plot all segments even if they are not visible.

    I wonder if detecting the intersection between each segment and one of the window borders is very interesting because it requires a lot of computations as well.

    Which solution is the best?

     
  • bouced

    bouced - 2023-10-13

    Here is a possible patch to fix this issue.
    Any segment is dropped if both end points are on the same side either of the top, the bottom, the left or the right.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.