mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-04-12 11:11:29 +03:00
fix transparent cursor
This commit is contained in:
@@ -930,7 +930,12 @@ impl Handler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn set_cursor_data(&mut self, cd: CursorData) {
|
fn set_cursor_data(&mut self, cd: CursorData) {
|
||||||
let colors = hbb_common::compress::decompress(&cd.colors);
|
let mut colors = hbb_common::compress::decompress(&cd.colors);
|
||||||
|
if colors.iter().filter(|x| **x != 0).next().is_none() {
|
||||||
|
log::info!("Fix transparent");
|
||||||
|
// somehow all 0 images shows black rect, here is a workaround
|
||||||
|
colors[3] = 1;
|
||||||
|
}
|
||||||
let mut png = Vec::new();
|
let mut png = Vec::new();
|
||||||
if let Ok(()) = repng::encode(&mut png, cd.width as _, cd.height as _, &colors) {
|
if let Ok(()) = repng::encode(&mut png, cd.width as _, cd.height as _, &colors) {
|
||||||
self.call(
|
self.call(
|
||||||
|
|||||||
Reference in New Issue
Block a user