mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-04 22:56:32 +08:00
Improve removeClippedSubviews for overflowing views
Summary: Historically, removeClippedSubviews for Nodes would not clip views that overflowed their parent. This patch changes that, so that Nodes can properly clip views when they are off screen (even if they have descendants that overflow the bounds of their parent). This is done by calculating a set of offsets from the actual width and height of the view, and using those in the clipping calculations. Reviewed By: sriramramani Differential Revision: D3409859
This commit is contained in:
@@ -13,6 +13,7 @@ import javax.annotation.Nullable;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import android.graphics.Rect;
|
||||
import android.view.View;
|
||||
import android.view.View.MeasureSpec;
|
||||
import android.view.ViewGroup;
|
||||
@@ -67,10 +68,10 @@ import com.facebook.react.uimanager.ViewManagerRegistry;
|
||||
@Nullable DrawCommand[] drawCommands,
|
||||
@Nullable AttachDetachListener[] listeners,
|
||||
@Nullable NodeRegion[] nodeRegions,
|
||||
boolean hasOverflowingElements) {
|
||||
Rect logicalAdjustment) {
|
||||
FlatViewGroup view = (FlatViewGroup) resolveView(reactTag);
|
||||
if (drawCommands != null) {
|
||||
view.mountDrawCommands(drawCommands, hasOverflowingElements);
|
||||
view.mountDrawCommands(drawCommands, logicalAdjustment);
|
||||
}
|
||||
if (listeners != null) {
|
||||
view.mountAttachDetachListeners(listeners);
|
||||
|
||||
Reference in New Issue
Block a user