Skip to content

Commit

Permalink
Dimensions are now rounded when divisor is not a multiple
Browse files Browse the repository at this point in the history
  • Loading branch information
MilesBHuff committed Apr 27, 2021
1 parent 9714f0d commit 7ef9651
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions application/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ fn main() {
h: usize,
}
let dim = Dim {
w: capturer.width() / args.divisor,
h: capturer.height() / args.divisor,
w: (capturer.width() as f32 / args.divisor as f32).round() as usize,
h: (capturer.height() as f32 / args.divisor as f32).round() as usize,
};
let pixels = dim.w * dim.h; // Theoretical maximum of 2,073,600 for 1920x1080; so a large integer (ie, u32) is needed.

Expand Down

0 comments on commit 7ef9651

Please sign in to comment.