Skip to content

Commit

Permalink
Fix off-by-one error in an accelerated compositor path
Browse files Browse the repository at this point in the history
  • Loading branch information
tannerhelland committed Aug 18, 2016
1 parent d706b65 commit 79174ce
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Classes/pdPixelBlender.cls
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ Friend Sub BlendDIBs(ByRef topDIB As pdDIB, ByRef bottomDIB As pdDIB, ByVal blen
End Select

'Composited results will have been placed inside the temporary top DIB copy. Apply the final blend now!
If applyFinalBlend Then m_topDIBCopy.AlphaBlendToDCEx bottomDIB.GetDIBDC, xOffsetBottom, yOffsetBottom, finalX - initX, finalY - initY, 0, 0, finalX - initX, finalY - initY, alphaModifier * 255
If applyFinalBlend Then m_topDIBCopy.AlphaBlendToDCEx bottomDIB.GetDIBDC, xOffsetBottom, yOffsetBottom, finalX - initX + 1, finalY - initY + 1, 0, 0, finalX - initX + 1, finalY - initY + 1, alphaModifier * 255

'That's all there is to it!

Expand Down Expand Up @@ -558,7 +558,12 @@ Private Sub ApplyBlendMode_Generic(ByRef topDIB As pdDIB, ByRef bottomDIB As pdD
newR = topR * bottomR
newG = topG * bottomG
newB = topB * bottomB


Case BL_SCREEN
newR = 1 - (1 - bottomR) * (1 - topR)
newG = 1 - (1 - bottomG) * (1 - topG)
newB = 1 - (1 - bottomB) * (1 - topB)

Case Else
newR = topR
newG = topG
Expand Down

0 comments on commit 79174ce

Please sign in to comment.