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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user