Skip to content

Commit 2428d09

Browse files
committed
Further cleaning of redunant arguments
1 parent 37f9e45 commit 2428d09

File tree

8 files changed

+11
-41
lines changed

8 files changed

+11
-41
lines changed

src/rendering/component/detailed_timer.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ pub(in crate::rendering) fn render<A: ResourceAllocator>(
6767
context,
6868
[width, top_height],
6969
&component.timer,
70-
layout_state
7170
);
7271

7372
if let Some(segment_name) = &component.segment_name {
@@ -86,7 +85,6 @@ pub(in crate::rendering) fn render<A: ResourceAllocator>(
8685
shadow_offset,
8786
shadow_color,
8887
timer_end,
89-
layout_state
9088
);
9189
}
9290

@@ -97,7 +95,6 @@ pub(in crate::rendering) fn render<A: ResourceAllocator>(
9795
context,
9896
[width, bottom_height],
9997
&component.segment_timer,
100-
layout_state
10198
);
10299

103100
context.translate(0.0, -top_height);
@@ -124,7 +121,6 @@ pub(in crate::rendering) fn render<A: ResourceAllocator>(
124121
shadow_offset,
125122
shadow_color,
126123
segment_timer_end,
127-
layout_state
128124
)
129125
.max(name_end);
130126

@@ -152,7 +148,6 @@ pub(in crate::rendering) fn render<A: ResourceAllocator>(
152148
shadow_offset,
153149
shadow_color,
154150
segment_timer_end,
155-
layout_state
156151
)
157152
.max(name_end);
158153

@@ -182,7 +177,6 @@ pub(in crate::rendering) fn render<A: ResourceAllocator>(
182177
comparison_times_color,
183178
shadow_offset,
184179
shadow_color,
185-
layout_state
186180
);
187181
}
188182
if let Some(comparison) = &component.comparison1 {
@@ -195,7 +189,6 @@ pub(in crate::rendering) fn render<A: ResourceAllocator>(
195189
comparison_times_color,
196190
shadow_offset,
197191
shadow_color,
198-
layout_state
199192
);
200193
}
201194
}

src/rendering/component/key_value.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,5 @@ pub(in crate::rendering) fn render<A: ResourceAllocator>(
4747
component.key_color.unwrap_or(layout_state.text_color),
4848
component.value_color.unwrap_or(layout_state.text_color),
4949
component.display_two_rows || layout_state.direction == LayoutDirection::Horizontal,
50-
layout_state
5150
);
5251
}

src/rendering/component/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ pub(super) fn render<A: ResourceAllocator>(
169169
text::render(cache.text(), context, dim, component, state)
170170
}
171171
ComponentState::Timer(component) => {
172-
timer::render(cache.timer(), context, dim, component, state);
172+
timer::render(cache.timer(), context, dim, component);
173173
}
174174
ComponentState::Title(component) => {
175175
title::render(cache.title(), context, dim, component, state)

src/rendering/component/splits.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,6 @@ pub(in crate::rendering) fn render<A: ResourceAllocator>(
208208
text_color,
209209
shadow_offset,
210210
shadow_color,
211-
layout_state
212211
);
213212
let label_width = right_x - left_x;
214213
if label_width > *max_width {
@@ -284,7 +283,6 @@ pub(in crate::rendering) fn render<A: ResourceAllocator>(
284283
solid(&column.visual_color),
285284
shadow_offset,
286285
shadow_color,
287-
layout_state
288286
);
289287
}
290288
right_x -= max_width + PADDING;
@@ -303,7 +301,6 @@ pub(in crate::rendering) fn render<A: ResourceAllocator>(
303301
shadow_offset,
304302
shadow_color,
305303
left_x - PADDING,
306-
layout_state
307304
);
308305
}
309306
context.translate(delta_x, delta_y);

src/rendering/component/text.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ pub(in crate::rendering) fn render<A: ResourceAllocator>(
4949
),
5050
shadow_offset,
5151
shadow_color,
52-
layout_state
5352
),
5453
TextState::Split(left, right) => context.render_key_value_component(
5554
left,
@@ -65,7 +64,6 @@ pub(in crate::rendering) fn render<A: ResourceAllocator>(
6564
component.left_center_color.unwrap_or(layout_state.text_color),
6665
component.right_color.unwrap_or(layout_state.text_color),
6766
component.display_two_rows || layout_state.direction == LayoutDirection::Horizontal,
68-
layout_state
6967
),
7068
}
7169
}

src/rendering/component/timer.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use crate::{
22
component::timer::State,
3-
layout::LayoutState,
43
rendering::{
54
consts::PADDING, font::CachedLabel, resource::ResourceAllocator, scene::Layer, FillShader,
65
RenderContext,
@@ -26,7 +25,6 @@ pub(in crate::rendering) fn render<A: ResourceAllocator>(
2625
context: &mut RenderContext<'_, A>,
2726
[width, height]: [f32; 2],
2827
component: &State,
29-
layout_state: &LayoutState
3028
) -> f32 {
3129
context.render_background([width, height], &component.background);
3230
let shadow_offset = [0.05, 0.05];
@@ -46,7 +44,6 @@ pub(in crate::rendering) fn render<A: ResourceAllocator>(
4644
shader,
4745
shadow_offset,
4846
shadow_color,
49-
layout_state
5047
);
5148
context.render_timer(
5249
&component.time,
@@ -57,6 +54,5 @@ pub(in crate::rendering) fn render<A: ResourceAllocator>(
5754
shader,
5855
shadow_offset,
5956
shadow_color,
60-
layout_state
6157
)
6258
}

src/rendering/component/title.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ pub(in crate::rendering) fn render<A: ResourceAllocator>(
8585
text_color,
8686
shadow_offset,
8787
shadow_color,
88-
layout_state
8988
) - PADDING;
9089

9190
let (line1_y, line1_end_x) = if !component.line2.is_empty() {
@@ -100,7 +99,6 @@ pub(in crate::rendering) fn render<A: ResourceAllocator>(
10099
shadow_offset,
101100
shadow_color,
102101
text_color,
103-
layout_state
104102
);
105103
(TEXT_ALIGN_TOP, width - PADDING)
106104
} else {
@@ -118,6 +116,5 @@ pub(in crate::rendering) fn render<A: ResourceAllocator>(
118116
shadow_offset,
119117
shadow_color,
120118
text_color,
121-
layout_state
122119
);
123120
}

src/rendering/mod.rs

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,6 @@ impl<A: ResourceAllocator> RenderContext<'_, A> {
568568
key_color: Color,
569569
value_color: Color,
570570
display_two_rows: bool,
571-
state: &LayoutState
572571
) {
573572
let left_of_value_x = self.render_numbers(
574573
value,
@@ -579,7 +578,6 @@ impl<A: ResourceAllocator> RenderContext<'_, A> {
579578
solid(&value_color),
580579
shadow_offset,
581580
value_shadow,
582-
state
583581
);
584582
let end_x = if display_two_rows {
585583
width
@@ -596,7 +594,6 @@ impl<A: ResourceAllocator> RenderContext<'_, A> {
596594
key_shadow,
597595
solid(&key_color),
598596
end_x - PADDING,
599-
state
600597
);
601598
}
602599

@@ -610,7 +607,6 @@ impl<A: ResourceAllocator> RenderContext<'_, A> {
610607
shadow_color: FillShader,
611608
shader: FillShader,
612609
max_x: f32,
613-
state: &LayoutState
614610
) -> f32 {
615611
let label = label.update(
616612
abbreviations,
@@ -619,7 +615,7 @@ impl<A: ResourceAllocator> RenderContext<'_, A> {
619615
(max_x - x) / scale,
620616
);
621617

622-
if state.drop_shadow {
618+
if self.state.drop_shadow {
623619
self.scene.bottom_layer_mut().push(Entity::Label(
624620
label.share(),
625621
shadow_color,
@@ -646,15 +642,15 @@ impl<A: ResourceAllocator> RenderContext<'_, A> {
646642
shadow_offset: Pos,
647643
shadow_color: FillShader,
648644
max_x: f32,
649-
state: &LayoutState
650645
) -> f32 {
651646
let label = label.update(
652647
text,
653648
&mut self.handles,
654649
&mut self.fonts.text.font,
655650
Some((max_x - x) / scale),
656651
);
657-
if state.drop_shadow {
652+
653+
if self.state.drop_shadow {
658654
self.scene.bottom_layer_mut().push(Entity::Label(
659655
label.share(),
660656
shadow_color,
@@ -681,15 +677,14 @@ impl<A: ResourceAllocator> RenderContext<'_, A> {
681677
shader: FillShader,
682678
shadow_offset: Pos,
683679
shadow_color: FillShader,
684-
state: &LayoutState
685680
) {
686681
let label = label.update(
687682
text,
688683
&mut self.handles,
689684
&mut self.fonts.text.font,
690685
Some((max_x - min_x) / scale),
691686
);
692-
if state.drop_shadow {
687+
if self.state.drop_shadow {
693688
self.scene.bottom_layer_mut().push(Entity::Label(
694689
label.share(),
695690
shadow_color,
@@ -729,15 +724,15 @@ impl<A: ResourceAllocator> RenderContext<'_, A> {
729724
shader: FillShader,
730725
shadow_offset: Pos,
731726
shadow_color: FillShader,
732-
state: &LayoutState
733727
) {
734728
let label = label.update(
735729
abbreviations,
736730
&mut self.handles,
737731
&mut self.fonts.text.font,
738732
(max_x - min_x) / scale,
739733
);
740-
if state.drop_shadow {
734+
735+
if self.state.drop_shadow {
741736
self.scene.bottom_layer_mut().push(Entity::Label(
742737
label.share(),
743738
shadow_color,
@@ -775,12 +770,11 @@ impl<A: ResourceAllocator> RenderContext<'_, A> {
775770
shader: FillShader,
776771
shadow_offset: Pos,
777772
shadow_color: FillShader,
778-
state: &LayoutState
779773
) -> f32 {
780774
let label = label.update(text, &mut self.handles, &mut self.fonts.text.font, None);
781775
let width = label.width(scale);
782776

783-
if state.drop_shadow {
777+
if self.state.drop_shadow {
784778
self.scene.layer_mut(layer).push(Entity::Label(
785779
label.share(),
786780
shadow_color,
@@ -809,7 +803,6 @@ impl<A: ResourceAllocator> RenderContext<'_, A> {
809803
shadow_offset: Pos,
810804
shadow_color: FillShader,
811805
shader: FillShader,
812-
state: &LayoutState
813806
) {
814807
if centered {
815808
self.render_abbreviated_text_centered(
@@ -822,10 +815,9 @@ impl<A: ResourceAllocator> RenderContext<'_, A> {
822815
shader,
823816
shadow_offset,
824817
shadow_color,
825-
state
826818
);
827819
} else {
828-
self.render_abbreviated_text_ellipsis(abbreviations, label, pos, scale, shadow_offset, shadow_color, shader, max_x, state);
820+
self.render_abbreviated_text_ellipsis(abbreviations, label, pos, scale, shadow_offset, shadow_color, shader, max_x);
829821
}
830822
}
831823

@@ -839,12 +831,11 @@ impl<A: ResourceAllocator> RenderContext<'_, A> {
839831
shader: FillShader,
840832
shadow_offset: Pos,
841833
shadow_color: FillShader,
842-
state: &LayoutState
843834
) -> f32 {
844835
let label = label.update(text, &mut self.handles, &mut self.fonts.times.font, None);
845836
let width = label.width(scale);
846837

847-
if state.drop_shadow {
838+
if self.state.drop_shadow {
848839
self.scene.layer_mut(layer).push(Entity::Label(
849840
label.share(),
850841
shadow_color,
@@ -870,11 +861,10 @@ impl<A: ResourceAllocator> RenderContext<'_, A> {
870861
shader: FillShader,
871862
shadow_offset: Pos,
872863
shadow_color: FillShader,
873-
state: &LayoutState
874864
) -> f32 {
875865
let label = label.update(text, &mut self.handles, &mut self.fonts.timer.font, None);
876866
let width = label.width(scale);
877-
if state.drop_shadow {
867+
if self.state.drop_shadow {
878868
self.scene.layer_mut(layer).push(Entity::Label(
879869
label.share(),
880870
shadow_color,

0 commit comments

Comments
 (0)