mirror of
https://github.com/emilk/egui.git
synced 2026-08-30 05:10:03 -04:00
Expand plot axes thickness to fit their labels (#3921)
Expand the plot axis thickness as the contained plot axis labels get wider. This fixes a problem where the plot labels would otherwise get clipped. 
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
use egui::{ahash, Context, Id, Pos2, Vec2b};
|
||||
|
||||
use crate::{PlotBounds, PlotTransform};
|
||||
@@ -23,6 +25,13 @@ pub struct PlotMemory {
|
||||
|
||||
/// Allows to remember the first click position when performing a boxed zoom
|
||||
pub(crate) last_click_pos_for_zoom: Option<Pos2>,
|
||||
|
||||
/// The thickness of each of the axes the previous frame.
|
||||
///
|
||||
/// This is used in the next frame to make the axes thicker
|
||||
/// in order to fit the labels, if necessary.
|
||||
pub(crate) x_axis_thickness: BTreeMap<usize, f32>,
|
||||
pub(crate) y_axis_thickness: BTreeMap<usize, f32>,
|
||||
}
|
||||
|
||||
impl PlotMemory {
|
||||
|
||||
Reference in New Issue
Block a user