Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix axis thickness for multiple X or Y axes #60

Merged
merged 1 commit into from
Dec 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions egui_plot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1343,6 +1343,12 @@ fn axis_widgets<'a>(
}
}

// The loops iterated through {x,y}_axes in reverse order, so we have to reverse the
// {x,y}_axis_widgets vec as well. Otherwise, the indices are messed up and the plot memory
// (mem.{x,y}_axis_thickness) will access the wrong axis given an index.
x_axis_widgets.reverse();
y_axis_widgets.reverse();

let mut plot_rect = rect_left;

// If too little space, remove axis widgets
Expand Down
Loading