Fix #60
This commit is contained in:
1 parent
6566813f29
commit
eed7fca895
2 files changed
+10
-15
No files matched your search
@@ -46,7 +46,7 @@ mavenPublishing {
|
||||
publishToMavenCentral()
|
||||
signAllPublications()
|
||||
|
||||
coordinates("io.github.kyant0", "backdrop", "1.0.0")
|
||||
coordinates("io.github.kyant0", "backdrop", "1.0.1")
|
||||
|
||||
pom {
|
||||
name.set("Backdrop")
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.kyant.backdrop
|
||||
|
||||
import androidx.compose.ui.graphics.drawscope.DrawScope
|
||||
import androidx.compose.ui.graphics.drawscope.draw
|
||||
import androidx.compose.ui.graphics.layer.GraphicsLayer
|
||||
import androidx.compose.ui.node.DelegatableNode
|
||||
import androidx.compose.ui.node.requireDensity
|
||||
@@ -14,18 +13,14 @@ internal fun DrawScope.recordLayer(
|
||||
size: IntSize = this.size.toIntSize(),
|
||||
block: DrawScope.() -> Unit
|
||||
) {
|
||||
layer.record(
|
||||
density = node.requireDensity(),
|
||||
layoutDirection = layoutDirection,
|
||||
size = size
|
||||
) {
|
||||
this@recordLayer.draw(
|
||||
density = drawContext.density,
|
||||
layoutDirection = drawContext.layoutDirection,
|
||||
canvas = drawContext.canvas,
|
||||
size = drawContext.size,
|
||||
graphicsLayer = drawContext.graphicsLayer,
|
||||
block = block
|
||||
)
|
||||
val density = node.requireDensity()
|
||||
layer.record(size) {
|
||||
val prevDensity = drawContext.density
|
||||
drawContext.density = density
|
||||
try {
|
||||
this.block()
|
||||
} finally {
|
||||
drawContext.density = prevDensity
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user