Skip to content

Conversation

@TihonovNV
Copy link

Currently PathShapes with NaN values skip too many line segments around NaN point.

For example, the following PathShape

[
    pos2(10.0, 290.0),
    pos2(30.0, 270.0),
    pos2(50.0, 250.0),
    pos2(70.0, 230.0),
    pos2(90.0, f32::NAN),
    pos2(110.0, 190.0),
    pos2(130.0, 170.0),
    pos2(150.0, 150.0),
]

is drawn like that (skipping one segment before and after NaN point):

image

I made a small change to tessellate disconnected segments of PathShape separately:

image

Additionally, closed PathShape will not be tessellated if it contains NaNs.

There is the same issue in egui_plot (emilk/egui_plot#131), I will fix it when this PR will be merged

@github-actions
Copy link

Preview is being built...

Preview will be available at https://egui-pr-preview.github.io/pr/7654-fix-nan-plotting

View snapshot changes at kitdiff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

epaint: Handle NaNs in Path

1 participant