Skip to content

Commit

Permalink
Stop setting topLeft on the GraphicsLayer
Browse files Browse the repository at this point in the history
The Skia doesn't like offsets which result in large amount of
offscreen drawing?
  • Loading branch information
chrisbanes committed Jul 5, 2024
1 parent 7f0bc2d commit 9c0bf63
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions haze/src/commonMain/kotlin/dev/chrisbanes/haze/HazeNode.kt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ import androidx.compose.ui.unit.Density
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.IntSize
import androidx.compose.ui.unit.LayoutDirection
import androidx.compose.ui.unit.round
import androidx.compose.ui.unit.roundToIntSize

/**
Expand Down Expand Up @@ -163,7 +162,10 @@ internal class HazeNode(
}
}

drawEffect(this, effect, effectLayer)
// Draw the effect's graphic layer, translated to the correct position
translate(effect.bounds.left, effect.bounds.top) {
drawEffect(this, effect, effectLayer)
}
}
}

Expand Down Expand Up @@ -227,7 +229,6 @@ internal class HazeNode(
density: Density,
) {
layer?.apply {
topLeft = bounds.topLeft.round()
colorFilter = when {
tint.alpha >= 0.005f -> ColorFilter.tint(tint, BlendMode.SrcOver)
else -> null
Expand Down

0 comments on commit 9c0bf63

Please sign in to comment.