Skip to content

Commit 2b7c53f

Browse files
committed
fix bug where plot/scroll area ratio changes when changing number of plots
1 parent 653fda4 commit 2b7c53f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/gui.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,9 @@ impl MyApp {
308308
let panel_height = ui.available_size().y;
309309
let height = ui.available_size().y * self.plot_serial_display_ratio;
310310
let plots_height = height;
311+
// need to subtract 12.0, this seems to be the height of the separator of two adjacent plots
311312
let plot_height =
312-
plots_height / (self.serial_devices.number_of_plots[self.device_idx] as f32);
313+
plots_height / (self.serial_devices.number_of_plots[self.device_idx] as f32) - 12.0;
313314
let spacing = 5.0;
314315
let width = ui.available_size().x - 2.0 * border - RIGHT_PANEL_WIDTH;
315316

0 commit comments

Comments
 (0)