From efec339946ea7961a7076495131cdce8d9ae790a Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Sat, 21 Jun 2008 19:38:56 +0000 Subject: [PATCH] Take the source alpha into account when doing a B_OP_INVERT so that drawing bitmaps in B_OP_INVERT mode does not affect pixels where the source bitmap was transparent, as noted in the BeBook. Not really sure I'm doing that right though and probably needs looking into for B_OP_ERASE and B_OP_SELECT too. Fixes bug #2421 though. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26067 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../drawing/Painter/drawing_modes/DrawingModeInvert.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/servers/app/drawing/Painter/drawing_modes/DrawingModeInvert.h b/src/servers/app/drawing/Painter/drawing_modes/DrawingModeInvert.h index 769165e175..47f99c62cd 100644 --- a/src/servers/app/drawing/Painter/drawing_modes/DrawingModeInvert.h +++ b/src/servers/app/drawing/Painter/drawing_modes/DrawingModeInvert.h @@ -133,7 +133,7 @@ blend_color_hspan_invert(int x, int y, unsigned len, if (covers) { // non-solid opacity do { - if (*covers) { + if (*covers && colors->a > 0) { if (*covers == 255) { ASSIGN_INVERT(p); } else { @@ -142,22 +142,23 @@ blend_color_hspan_invert(int x, int y, unsigned len, } covers++; p += 4; -// ++colors; + ++colors; } while(--len); } else { // solid full opcacity if (cover == 255) { do { - ASSIGN_INVERT(p); + if (colors->a > 0) { + ASSIGN_INVERT(p); + } p += 4; -// ++colors; + ++colors; } while(--len); // solid partial opacity } else if (cover) { do { BLEND_INVERT(p, cover); p += 4; -// ++colors; } while(--len); } }