Skip to content

Commit

Permalink
remove unused declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
alexzhirkevich committed Mar 3, 2024
1 parent 3b9630b commit 7655406
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 164 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ import io.github.alexzhirkevich.qrose.options.image
import io.github.alexzhirkevich.qrose.options.roundCorners
import io.github.alexzhirkevich.qrose.options.solid
import io.github.alexzhirkevich.qrose.rememberQrCodePainter
import io.github.alexzhirkevich.qrose.toByteArray
import org.jetbrains.compose.resources.ExperimentalResourceApi
import org.jetbrains.compose.resources.painterResource
import qrose.example.shared.generated.resources.Res
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,48 +15,6 @@ import androidx.compose.ui.unit.LayoutDirection
import androidx.compose.ui.unit.toSize
import kotlin.math.ceil

abstract class CachedPainter : Painter() {

private var alpha = 1f
private var colorFilter : ColorFilter?= null

private var cachedSize: Size? = null

private var cacheDrawScope = DrawCache()

override fun applyAlpha(alpha: Float): Boolean {
this.alpha = alpha
return true
}

override fun applyColorFilter(colorFilter: ColorFilter?): Boolean {
this.colorFilter = colorFilter
return true
}

abstract fun DrawScope.onCache()

private val block : DrawScope.() -> Unit = { onCache() }

override fun DrawScope.onDraw() {
if (cachedSize != size) {

cacheDrawScope.drawCachedImage(
size = IntSize(ceil(size.width).toInt(), ceil(size.height).toInt()),
density = this,
layoutDirection = layoutDirection,
block = block
)
cachedSize = size
}
cacheDrawScope.drawInto(
target = this,
alpha = alpha,
colorFilter = colorFilter
)
}
}

/**
* Creates a drawing environment that directs its drawing commands to an [ImageBitmap]
* which can be drawn directly in another [DrawScope] instance. This is useful to cache
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,30 @@ import androidx.compose.ui.geometry.Size
import androidx.compose.ui.graphics.BlendMode
import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.ColorFilter
import androidx.compose.ui.graphics.Matrix
import androidx.compose.ui.graphics.Path
import androidx.compose.ui.graphics.PathFillType
import androidx.compose.ui.graphics.PathOperation
import androidx.compose.ui.graphics.drawscope.DrawScope
import androidx.compose.ui.graphics.drawscope.translate
import androidx.compose.ui.graphics.painter.Painter
import androidx.compose.ui.unit.IntSize
import io.github.alexzhirkevich.qrose.options.QrErrorCorrectionLevel
import io.github.alexzhirkevich.qrose.options.QrOptions
import io.github.alexzhirkevich.qrose.options.dsl.QrOptionsBuilderScope
import io.github.alexzhirkevich.qrose.options.Neighbors
import io.github.alexzhirkevich.qrose.options.QrBrush
import io.github.alexzhirkevich.qrose.options.QrBrushMode
import io.github.alexzhirkevich.qrose.options.QrCodeMatrix
import io.github.alexzhirkevich.qrose.options.QrColors
import io.github.alexzhirkevich.qrose.options.QrErrorCorrectionLevel
import io.github.alexzhirkevich.qrose.options.QrLogo
import io.github.alexzhirkevich.qrose.options.QrLogoPadding
import io.github.alexzhirkevich.qrose.options.QrOptions
import io.github.alexzhirkevich.qrose.options.QrShapeModifier
import io.github.alexzhirkevich.qrose.options.QrShapes
import io.github.alexzhirkevich.qrose.options.dsl.QrOptionsBuilderScope
import io.github.alexzhirkevich.qrose.options.isSpecified
import io.github.alexzhirkevich.qrose.options.neighbors
import io.github.alexzhirkevich.qrose.options.newPath
import io.github.alexzhirkevich.qrose.qrcode.ErrorCorrectionLevel
import io.github.alexzhirkevich.qrose.qrcode.QRCode
import kotlin.math.ceil
import kotlin.math.roundToInt

/**
Expand Down

This file was deleted.

0 comments on commit 7655406

Please sign in to comment.