Skip to content

Commit de61ab9

Browse files
committed
Use separate variables for the height and stride
The button height calculation is adjusted accordingly.
1 parent 425923b commit de61ab9

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/main.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ use pixel_shift::PIXEL_SHIFT_WIDTH_PX;
4141
use fonts::{FontConfig, Pattern};
4242

4343
const DFR_WIDTH: i32 = 2008;
44-
const DFR_HEIGHT: i32 = 64;
44+
const DFR_HEIGHT: i32 = 60;
45+
const DFR_STRIDE: i32 = 64;
4546
const BUTTON_SPACING_PX: i32 = 16;
4647
const BUTTON_COLOR_INACTIVE: f64 = 0.200;
4748
const BUTTON_COLOR_ACTIVE: f64 = 0.400;
@@ -121,7 +122,7 @@ impl FunctionLayer {
121122
let pixel_shift_width = if config.enable_pixel_shift { PIXEL_SHIFT_WIDTH_PX } else { 0 };
122123
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;
123124
let radius = 8.0f64;
124-
let bot = (DFR_HEIGHT as f64) * 0.2;
125+
let bot = (DFR_HEIGHT as f64) * 0.15;
125126
let top = (DFR_HEIGHT as f64) * 0.85;
126127
let (pixel_shift_x, pixel_shift_y) = pixel_shift;
127128

@@ -271,7 +272,7 @@ fn main() {
271272
.apply()
272273
.unwrap_or_else(|e| { panic!("Failed to drop privileges: {}", e) });
273274

274-
let mut surface = ImageSurface::create(Format::ARgb32, DFR_HEIGHT, DFR_WIDTH).unwrap();
275+
let mut surface = ImageSurface::create(Format::ARgb32, DFR_STRIDE, DFR_WIDTH).unwrap();
275276
let mut active_layer = 0;
276277
let fkey_layer = FunctionLayer {
277278
buttons: vec![

0 commit comments

Comments
 (0)