Skip to content

Commit

Permalink
Return apply if the local inspection mode is true on the palette plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
skydoves committed Apr 13, 2024
1 parent 9ee51c5 commit 6545764
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.Immutable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.ImageBitmap
import androidx.compose.ui.platform.LocalInspectionMode
import com.skydoves.landscapist.ImageOptions
import com.skydoves.landscapist.plugins.ImagePlugin

Expand Down Expand Up @@ -53,6 +54,8 @@ public data class PalettePlugin(
imageBitmap: ImageBitmap?,
): ImagePlugin =
apply {
if (LocalInspectionMode.current) return@apply

imageBitmap?.let {
bitmapPalette.applyImageModel(this.imageModel ?: imageModel)
bitmapPalette.generate(it)
Expand Down

0 comments on commit 6545764

Please # to comment.