1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-31 13:50:04 -04:00

Add #[inline] to all builder-pattern functions (#3557)

Better performance and maybe code size
This commit is contained in:
Emil Ernerfeldt
2023-11-16 13:50:05 +01:00
committed by GitHub
parent 4886c8c8c0
commit a243180600
32 changed files with 398 additions and 35 deletions

View File

@@ -46,18 +46,21 @@ impl Default for Legend {
impl Legend {
/// Which text style to use for the legend. Default: `TextStyle::Body`.
#[inline]
pub fn text_style(mut self, style: TextStyle) -> Self {
self.text_style = style;
self
}
/// The alpha of the legend background. Default: `0.75`.
#[inline]
pub fn background_alpha(mut self, alpha: f32) -> Self {
self.background_alpha = alpha;
self
}
/// In which corner to place the legend. Default: `Corner::RightTop`.
#[inline]
pub fn position(mut self, corner: Corner) -> Self {
self.position = corner;
self