Skip to content

Commit

Permalink
Use blendMode over xfermode
Browse files Browse the repository at this point in the history
(to support QR for devices with hardware acceleration enabled)
  • Loading branch information
MHShetty authored and thestinger committed Jul 23, 2024
1 parent a8b7c55 commit db898e4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app/src/main/java/app/grapheneos/camera/ui/QROverlay.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ package app.grapheneos.camera.ui

import android.content.Context
import android.content.res.Resources
import android.graphics.BlendMode
import android.graphics.Canvas
import android.graphics.Color
import android.graphics.Paint
import android.graphics.PorterDuff
import android.graphics.PorterDuffXfermode
import android.graphics.RectF
import android.util.AttributeSet
import android.view.View
Expand All @@ -28,7 +27,7 @@ class QROverlay(context: Context, attrs: AttributeSet) : View(context, attrs) {

private val eraserPaint: Paint = Paint().apply {
strokeWidth = boxPaint.strokeWidth
xfermode = PorterDuffXfermode(PorterDuff.Mode.CLEAR)
blendMode = BlendMode.CLEAR
}

private val boxCornerRadius: Float =
Expand Down

0 comments on commit db898e4

Please sign in to comment.