mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-07 02:08:34 +08:00
RN: Fix Drawing Rect for ReactScrollView
Summary: Fixes `ReactScrollView` so that it respects the drawing rect (i.e. the bounding box of the element). In JavaScript, this is the backing view for `ScrollView` (vertical) on Android. Reviewed By: fadinghorse Differential Revision: D8710256 fbshipit-source-id: f3bd96e39b8569cfcb21e486944b70fdb57c12b6
This commit is contained in:
committed by
Facebook Github Bot
parent
6dcadca712
commit
6a16bec882
@@ -47,6 +47,7 @@ public class ReactScrollView extends ScrollView implements ReactClippingViewGrou
|
||||
private final OnScrollDispatchHelper mOnScrollDispatchHelper = new OnScrollDispatchHelper();
|
||||
private final @Nullable OverScroller mScroller;
|
||||
private final VelocityHelper mVelocityHelper = new VelocityHelper();
|
||||
private final Rect mRect = new Rect(); // for reuse to avoid allocation
|
||||
|
||||
private @Nullable Rect mClippingRect;
|
||||
private boolean mDoneFlinging;
|
||||
@@ -351,6 +352,8 @@ public class ReactScrollView extends ScrollView implements ReactClippingViewGrou
|
||||
mEndBackground.draw(canvas);
|
||||
}
|
||||
}
|
||||
getDrawingRect(mRect);
|
||||
canvas.clipRect(mRect);
|
||||
super.draw(canvas);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user