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 @@ -19,10 +19,11 @@
import androidx.annotation.NonNull;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.bridge.UIManager;
import com.facebook.react.uimanager.BackgroundStyleApplicator;
import com.facebook.react.uimanager.UIManagerHelper;
import com.facebook.react.uimanager.ViewProps;
import com.facebook.react.views.view.ReactViewGroup;

import java.lang.reflect.Method;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;

Expand Down Expand Up @@ -118,17 +119,13 @@ private static void drawBackgroundIfPresent(Canvas canvas, View view, float opac
}

private static void drawChildren(Canvas canvas, ViewGroup group, Paint paint, float parentOpacity) {
// Handle clipping for ReactViewGroup
if (group instanceof ReactViewGroup) {
try {
Class[] cArg = new Class[1];
cArg[0] = Canvas.class;
Method method = ReactViewGroup.class.getDeclaredMethod("dispatchOverflowDraw", cArg);
method.setAccessible(true);
method.invoke(group, canvas);
} catch (Exception e) {
Log.e(TAG, "couldn't invoke dispatchOverflowDraw() on ReactViewGroup", e);
}
// ReactViewGroup applies `overflow: hidden` / `overflow: scroll` clipping from its
// dispatchDraw() override. We never call dispatchDraw() here because children are
// walked manually (TextureView / SurfaceView need special handling), so the clip has
// to be replicated explicitly, exactly as ReactViewGroup.dispatchDraw() does it.
if (group instanceof ReactViewGroup
&& !ViewProps.VISIBLE.equals(((ReactViewGroup) group).getOverflow())) {
BackgroundStyleApplicator.clipToPaddingBox(group, canvas);
}
for (int i = 0; i < group.getChildCount(); i++) {
View child = group.getChildAt(i);
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -20862,14 +20862,14 @@ __metadata:
linkType: hard

"js-yaml@npm:^3.13.1, js-yaml@npm:^3.14.1":
version: 3.15.0
resolution: "js-yaml@npm:3.15.0"
version: 3.15.1
resolution: "js-yaml@npm:3.15.1"
dependencies:
argparse: ^1.0.7
esprima: ^4.0.0
bin:
js-yaml: bin/js-yaml.js
checksum: 0209830c3ce51cec4c2cefee4b2b68c547b56b36920004efbf7c6a91ae7eee784bf64341738ef1acffa975d16e7882e9b69234b9a4411f455b72b33d4d74771e
checksum: 536cfb984b61d1544dbdbe394254dd13481a94171cb3a61608572d9112a63cbace9dd900cb83a4e530ac36427fff77d9e1cb6734917c6fea951d00b4f7bbb163
languageName: node
linkType: hard

Expand Down
Loading