@@ -5,7 +5,7 @@ use ratatui::layout::Rect;
55use tracing:: warn;
66use yazi_shared:: env_exists;
77
8- use crate :: { Brand , Emulator , SHOWN , TMUX , WSL , drivers} ;
8+ use crate :: { Brand , Emulator , Offset , SHOWN , TMUX , WSL , drivers} ;
99
1010#[ derive( Clone , Copy , PartialEq , Eq , Debug ) ]
1111pub enum Adapter {
@@ -35,18 +35,18 @@ impl Display for Adapter {
3535}
3636
3737impl Adapter {
38- pub async fn image_show ( self , path : & Path , max : Rect ) -> Result < Rect > {
38+ pub async fn image_show ( self , path : & Path , max : Rect , offset : Option < Offset > ) -> Result < Rect > {
3939 if max. is_empty ( ) {
4040 return Ok ( Rect :: default ( ) ) ;
4141 }
4242
4343 match self {
44- Self :: Kgp => drivers:: Kgp :: image_show ( path, max) . await ,
45- Self :: KgpOld => drivers:: KgpOld :: image_show ( path, max) . await ,
46- Self :: Iip => drivers:: Iip :: image_show ( path, max) . await ,
47- Self :: Sixel => drivers:: Sixel :: image_show ( path, max) . await ,
48- Self :: X11 | Self :: Wayland => drivers:: Ueberzug :: image_show ( path, max) . await ,
49- Self :: Chafa => drivers:: Chafa :: image_show ( path, max) . await ,
44+ Self :: Kgp => drivers:: Kgp :: image_show ( path, max, offset ) . await ,
45+ Self :: KgpOld => drivers:: KgpOld :: image_show ( path, max, offset ) . await ,
46+ Self :: Iip => drivers:: Iip :: image_show ( path, max, offset ) . await ,
47+ Self :: Sixel => drivers:: Sixel :: image_show ( path, max, offset ) . await ,
48+ Self :: X11 | Self :: Wayland => drivers:: Ueberzug :: image_show ( path, max, offset ) . await ,
49+ Self :: Chafa => drivers:: Chafa :: image_show ( path, max, offset ) . await ,
5050 }
5151 }
5252
0 commit comments