mirror of
https://github.com/robbert-vdh/nih-plug.git
synced 2026-07-01 02:36:54 +00:00
fix transparency in softbuffer example
This commit is contained in:
committed by
Robbert van der Helm
parent
d64b2ab9cf
commit
7da01b5f21
@@ -81,8 +81,10 @@ impl baseview::WindowHandler for CustomSoftbufferWindow {
|
||||
let red = x % 255;
|
||||
let green = y % 255;
|
||||
let blue = (x * y) % 255;
|
||||
let alpha = 255;
|
||||
|
||||
let index = y as usize * self.physical_width as usize + x as usize;
|
||||
buffer[index] = blue | (green << 8) | (red << 16);
|
||||
buffer[index] = blue | (green << 8) | (red << 16) | (alpha << 24);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user