Skip to content

Commit

Permalink
feat: 优化性能
Browse files Browse the repository at this point in the history
  • Loading branch information
nashaofu committed Jul 13, 2024
1 parent d4b249c commit 2157290
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/windows/capture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,11 @@ fn to_rgba_image(
}
};

let is_old_version = get_os_major_version() < 8;
for src in buffer.chunks_exact_mut(4) {
src.swap(0, 2);
// fix https://github.com/nashaofu/xcap/issues/92#issuecomment-1910014951
if src[3] == 0 && get_os_major_version() < 8 {
if src[3] == 0 && is_old_version {
src[3] = 255;
}
}
Expand Down

0 comments on commit 2157290

Please sign in to comment.