File tree Expand file tree Collapse file tree 3 files changed +5
-4
lines changed Expand file tree Collapse file tree 3 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ impl DrawableComponent for SelectBranchComponent {
5353 f. size ( ) ,
5454 ) ;
5555 let area =
56- ui:: rect_inside ( & MIN_SIZE , & f. size ( ) . into ( ) , area) ;
56+ ui:: rect_inside ( MIN_SIZE , f. size ( ) . into ( ) , area) ;
5757 let area = area. intersection ( rect) ;
5858
5959 let scroll_threshold = area. height / 3 ;
Original file line number Diff line number Diff line change @@ -202,8 +202,8 @@ impl DrawableComponent for TextInputComponent {
202202 InputType :: Multiline => {
203203 let area = ui:: centered_rect ( 60 , 20 , f. size ( ) ) ;
204204 ui:: rect_inside (
205- & Size :: new ( 10 , 3 ) ,
206- & f. size ( ) . into ( ) ,
205+ Size :: new ( 10 , 3 ) ,
206+ f. size ( ) . into ( ) ,
207207 area,
208208 )
209209 }
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ pub const fn calc_scroll_top(
2222}
2323
2424/// ui component size representation
25+ #[ derive( Copy , Clone ) ]
2526pub struct Size {
2627 pub width : u16 ,
2728 pub height : u16 ,
@@ -72,7 +73,7 @@ pub fn centered_rect(
7273}
7374
7475/// makes sure Rect `r` at least stays as big as min and not bigger than max
75- pub fn rect_inside ( min : & Size , max : & Size , r : Rect ) -> Rect {
76+ pub fn rect_inside ( min : Size , max : Size , r : Rect ) -> Rect {
7677 let new_width = r. width . max ( min. width ) . min ( max. width ) ;
7778 let new_height = r. height . max ( min. height ) . min ( max. height ) ;
7879 let diff_width = new_width. saturating_sub ( r. width ) ;
You can’t perform that action at this time.
0 commit comments