File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -118,7 +118,8 @@ impl FunctionLayer {
118118 let c = Context :: new ( & surface) . unwrap ( ) ;
119119 c. translate ( DFR_HEIGHT as f64 , 0.0 ) ;
120120 c. rotate ( ( 90.0f64 ) . to_radians ( ) ) ;
121- let button_width = ( ( DFR_WIDTH - PIXEL_SHIFT_WIDTH_PX as i32 ) - ( BUTTON_SPACING_PX * ( self . buttons . len ( ) - 1 ) as i32 ) ) as f64 / self . buttons . len ( ) as f64 ;
121+ let pixel_shift_width = if config. enable_pixel_shift { PIXEL_SHIFT_WIDTH_PX } else { 0 } ;
122+ let button_width = ( ( DFR_WIDTH - pixel_shift_width as i32 ) - ( BUTTON_SPACING_PX * ( self . buttons . len ( ) - 1 ) as i32 ) ) as f64 / self . buttons . len ( ) as f64 ;
122123 let radius = 8.0f64 ;
123124 let bot = ( DFR_HEIGHT as f64 ) * 0.2 ;
124125 let top = ( DFR_HEIGHT as f64 ) * 0.85 ;
@@ -129,7 +130,7 @@ impl FunctionLayer {
129130 c. set_font_face ( & config. font_face ) ;
130131 c. set_font_size ( 32.0 ) ;
131132 for ( i, button) in self . buttons . iter ( ) . enumerate ( ) {
132- let left_edge = ( i as f64 * ( button_width + BUTTON_SPACING_PX as f64 ) ) . floor ( ) + pixel_shift_x + ( PIXEL_SHIFT_WIDTH_PX / 2 ) as f64 ;
133+ let left_edge = ( i as f64 * ( button_width + BUTTON_SPACING_PX as f64 ) ) . floor ( ) + pixel_shift_x + ( pixel_shift_width / 2 ) as f64 ;
133134 let color = if active_buttons[ i] {
134135 BUTTON_COLOR_ACTIVE
135136 } else if config. show_button_outlines {
You can’t perform that action at this time.
0 commit comments