Skip to content

Commit

Permalink
Fix changing alpha with alpha lock
Browse files Browse the repository at this point in the history
Deleted line should not change value of alpha.
This line, with lossless precision, can be written as:
   alpha = alpha*mask*opacity + alpha*(1 - mask*opacity)
and simplified to:
   alpha = alpha * 1
but use of fixed point math introduces loss of precision.
  • Loading branch information
gwojcik authored and jplloyd committed Apr 15, 2021
1 parent a7b3d69 commit 4f1d5c5
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion brushmodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,6 @@ void draw_dab_pixels_BlendMode_LockAlpha_Paint (uint16_t * mask,
// convert back to RGB
float rgb_result[3] = {0};
spectral_to_rgb(spectral_result, rgb_result);
rgba[3] = opa_a + opa_b * rgba[3] / (1<<15);

for (int i=0; i<3; i++) {
rgba[i] =(rgb_result[i] * rgba[3]) + 0.5;
Expand Down

0 comments on commit 4f1d5c5

Please sign in to comment.