Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ internal object FilterHelper {
// https://www.w3.org/TR/filter-effects-1/#blurEquivalent
fun createBlurEffect(sigma: Float, chainedEffects: RenderEffect? = null): RenderEffect? {
if (sigma <= 0.5) {
return null
return chainedEffects
}

val radius: Float = sigmaToRadius(sigma)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

package com.facebook.react.uimanager

import com.facebook.react.bridge.JavaOnlyArray
import com.facebook.react.bridge.JavaOnlyMap
import org.assertj.core.api.Assertions.assertThat
import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.RobolectricTestRunner

@RunWith(RobolectricTestRunner::class)
class FilterHelperTest {

@Test
fun `parseFilters keeps earlier filters when blur is too small to draw`() {
val filters = JavaOnlyArray.of(JavaOnlyMap.of("grayscale", 1.0), JavaOnlyMap.of("blur", 0.0))

assertThat(FilterHelper.parseFilters(filters)).isNotNull()
}
}
Loading