1313// limitations under the License.
1414
1515use crate :: commands:: SCROLL_TO_VIEW ;
16+ use crate :: contexts:: CommandCtx ;
1617use crate :: debug_state:: DebugState ;
1718use crate :: kurbo:: { Point , Rect , Size , Vec2 } ;
1819use crate :: widget:: prelude:: * ;
1920use crate :: widget:: Axis ;
2021use crate :: { Data , InternalLifeCycle , WidgetPod } ;
2122use tracing:: { info, instrument, trace, warn} ;
22- use crate :: contexts:: CommandCtx ;
2323
2424/// Represents the size and position of a rectangular "viewport" into a larger area.
2525#[ derive( Clone , Copy , Default , Debug , PartialEq ) ]
@@ -362,7 +362,13 @@ impl<T, W: Widget<T>> ClipBox<T, W> {
362362 /// Pans by `delta` units.
363363 ///
364364 /// Returns `true` if the scroll offset has changed.
365- pub fn pan_by < ' a , C : CommandCtx < ' a > > ( & mut self , ctx : & mut C , data : & T , env : & Env , delta : Vec2 ) -> bool {
365+ pub fn pan_by < ' a , C : CommandCtx < ' a > > (
366+ & mut self ,
367+ ctx : & mut C ,
368+ data : & T ,
369+ env : & Env ,
370+ delta : Vec2 ,
371+ ) -> bool {
366372 self . with_port ( ctx, data, env, |_, port| {
367373 port. pan_by ( delta) ;
368374 } )
@@ -372,7 +378,13 @@ impl<T, W: Widget<T>> ClipBox<T, W> {
372378 ///
373379 /// If the target region is larger than the viewport, we will display the
374380 /// portion that fits, prioritizing the portion closest to the origin.
375- pub fn pan_to_visible < ' a , C : CommandCtx < ' a > > ( & mut self , ctx : & mut C , data : & T , env : & Env , region : Rect ) -> bool {
381+ pub fn pan_to_visible < ' a , C : CommandCtx < ' a > > (
382+ & mut self ,
383+ ctx : & mut C ,
384+ data : & T ,
385+ env : & Env ,
386+ region : Rect ,
387+ ) -> bool {
376388 self . with_port ( ctx, data, env, |_, port| {
377389 port. pan_to_visible ( region) ;
378390 } )
@@ -381,7 +393,14 @@ impl<T, W: Widget<T>> ClipBox<T, W> {
381393 /// Pan to this position on a particular axis.
382394 ///
383395 /// Returns `true` if the scroll offset has changed.
384- pub fn pan_to_on_axis < ' a , C : CommandCtx < ' a > > ( & mut self , ctx : & mut C , data : & T , env : & Env , axis : Axis , position : f64 ) -> bool {
396+ pub fn pan_to_on_axis < ' a , C : CommandCtx < ' a > > (
397+ & mut self ,
398+ ctx : & mut C ,
399+ data : & T ,
400+ env : & Env ,
401+ axis : Axis ,
402+ position : f64 ,
403+ ) -> bool {
385404 self . with_port ( ctx, data, env, |_, port| {
386405 port. pan_to_on_axis ( axis, position) ;
387406 } )
@@ -421,7 +440,7 @@ impl<T: Data, W: Widget<T>> Widget<T> for ClipBox<T, W> {
421440 // prevent unexpected behaviour, by clipping SCROLL_TO_VIEW notifications
422441 // to this ClipBox's viewport.
423442 ctx. set_handled ( ) ;
424- self . with_port ( ctx, data, env, |ctx, port| {
443+ self . with_port ( ctx, data, env, |ctx, port| {
425444 port. fixed_scroll_to_view_handling (
426445 ctx,
427446 * global_highlight_rect,
0 commit comments