Skip to content

Commit

Permalink
fix blend options for image printer
Browse files Browse the repository at this point in the history
  • Loading branch information
Harley-xk committed Oct 16, 2020
1 parent b08a4e5 commit 3b8b213
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions MaLiang/Classes/Brush/Printer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ public final class Printer: Brush {
attachment.isBlendingEnabled = true

attachment.rgbBlendOperation = .add
attachment.sourceRGBBlendFactor = .one
attachment.destinationRGBBlendFactor = .oneMinusSourceAlpha

attachment.alphaBlendOperation = .add

attachment.sourceRGBBlendFactor = .sourceAlpha
attachment.sourceAlphaBlendFactor = .one

attachment.destinationRGBBlendFactor = .oneMinusSourceAlpha
attachment.destinationAlphaBlendFactor = .oneMinusSourceAlpha
}

Expand Down
2 changes: 1 addition & 1 deletion MaLiang/Classes/MetalBase/MetalView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ open class MetalView: MTKView {

open override var backgroundColor: UIColor? {
didSet {
clearColor = (backgroundColor ?? .white).toClearColor()
clearColor = (backgroundColor ?? .black).toClearColor()
}
}

Expand Down

0 comments on commit 3b8b213

Please sign in to comment.