hageldave / JPlotter

OpenGL based 2D Plotting Library for Java using AWT and LWJGL
https://github.com/hageldave/JPlotter/wiki
MIT License
45 stars 6 forks source link

Zooming in on Bezier Curves leads to freeze #19

Closed hageldave closed 4 years ago

hageldave commented 4 years ago

The subdivision routine generates segments of max 30 (?) pixels length to yield a smooth looking curve. When zooming in on a bezier curve many of these segments are generated for the whole curve even when they are outside of the view. In extreme cases so many segments are created that building the vertex array (presumably) takes very long so that the UI freezes on draw.

The subdivision routine needs to cull (or not generate) segments that are outside of the view to avoid this issue.