1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-27 15:13:12 -04:00

Add some vertical spacing

This commit is contained in:
Emil Ernerfeldt
2023-08-14 14:04:24 +02:00
parent 93c763be5d
commit 4217f4ba7c
3 changed files with 10 additions and 2 deletions

View File

@@ -13,6 +13,7 @@ pub(super) type AxisFormatterFn = fn(f64, usize, &RangeInclusive<f64>) -> String
/// Generic constant for x-Axis
pub(super) const X_AXIS: usize = 0;
/// Generic constant for y-Axis
pub(super) const Y_AXIS: usize = 1;
@@ -29,12 +30,14 @@ pub enum Placement {
// shorthand types for AxisHints, public API
/// Configuration for x-axis
pub type XAxisHints = AxisHints<X_AXIS>;
/// Configuration for y-axis
pub type YAxisHints = AxisHints<Y_AXIS>;
// shorthand types for AxisWidget
pub(super) type XAxisWidget = AxisWidget<X_AXIS>;
pub(super) type YAxisWidget = AxisWidget<Y_AXIS>;
/// Axis configuration.
///
/// Used to configure axis label and ticks.

View File

@@ -1,8 +1,8 @@
use epaint::Pos2;
use crate::{Id, Context};
use crate::{Context, Id};
use super::{AxisBools, transform::ScreenTransform};
use super::{transform::ScreenTransform, AxisBools};
/// Information about the plot that has to persist between frames.
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
@@ -11,9 +11,13 @@ pub(super) struct PlotMemory {
/// Indicates if the user has modified the bounds, for example by moving or zooming,
/// or if the bounds should be calculated based by included point or auto bounds.
pub(super) bounds_modified: AxisBools,
pub(super) hovered_entry: Option<String>,
pub(super) hidden_items: ahash::HashSet<String>,
pub(super) last_screen_transform: ScreenTransform,
/// Allows to remember the first click position when performing a boxed zoom
pub(super) last_click_pos_for_zoom: Option<Pos2>,
}

View File

@@ -579,6 +579,7 @@ impl Plot {
}
self
}
/// Set the y axis label of the main y-axis
///
/// If no y-axis has been specified so far a new one will be created.