@@ -7,7 +7,7 @@ use crate::{
77 error:: Error ,
88 event:: { KeyEvent , MouseEvent } ,
99 render:: WebEventHandler ,
10- CursorShape ,
10+ CellSized , CursorShape ,
1111} ;
1212pub use beamterm_renderer:: SelectionMode ;
1313use beamterm_renderer:: {
@@ -29,7 +29,6 @@ use std::{
2929} ;
3030use web_sys:: { wasm_bindgen:: JsCast , Element } ;
3131
32- use crate :: backend:: cell_sized:: CellSized ;
3332/// Re-export beamterm's atlas data type. Used by [`FontAtlasConfig::Static`].
3433pub use beamterm_renderer:: FontAtlasData ;
3534
@@ -680,8 +679,8 @@ impl WebGl2Backend {
680679
681680impl CellSized for WebGl2Backend {
682681 fn cell_size_px ( & self ) -> ( f32 , f32 ) {
683- let ( w , h ) = self . beamterm . cell_size ( ) ;
684- ( w as f32 , h as f32 )
682+ let cs = self . beamterm . cell_size ( ) ;
683+ ( cs . width as f32 , cs . height as f32 )
685684 }
686685
687686 fn cell_size_css_px ( & self ) -> ( f32 , f32 ) {
@@ -747,16 +746,16 @@ impl Backend for WebGl2Backend {
747746 }
748747
749748 fn size ( & self ) -> IoResult < Size > {
750- let ( w , h ) = self . beamterm . terminal_size ( ) ;
751- Ok ( Size :: new ( w , h ) )
749+ let ts = self . beamterm . terminal_size ( ) ;
750+ Ok ( Size :: new ( ts . cols , ts . rows ) )
752751 }
753752
754753 fn window_size ( & mut self ) -> IoResult < WindowSize > {
755- let ( cols , rows ) = self . beamterm . terminal_size ( ) ;
754+ let ts = self . beamterm . terminal_size ( ) ;
756755 let ( w, h) = self . beamterm . canvas_size ( ) ;
757756
758757 Ok ( WindowSize {
759- columns_rows : Size :: new ( cols, rows) ,
758+ columns_rows : Size :: new ( ts . cols , ts . rows ) ,
760759 pixels : Size :: new ( w as _ , h as _ ) ,
761760 } )
762761 }
0 commit comments