Permalink
Browse files

Fix ReactHorizontalScrollView overflow issue

Summary: Fix ReactHorizontalScrollView so that its children won't overflow. (Task: https://our.intern.facebook.com/intern/tasks/?t=31128239)

Reviewed By: achen1

Differential Revision: D8923947

fbshipit-source-id: 56c36b25c29a87a306d92544273603d0d086edc0
  • Loading branch information...
Jiaqi Wu authored and facebook-github-bot committed Jul 20, 2018
1 parent 86f24cc commit d5465a9a0a840f7e759bb8fb6679b01017eb3d05
@@ -38,6 +38,7 @@
private final OnScrollDispatchHelper mOnScrollDispatchHelper = new OnScrollDispatchHelper();
private final VelocityHelper mVelocityHelper = new VelocityHelper();
private final Rect mRect = new Rect();
private boolean mActivelyScrolling;
private @Nullable Rect mClippingRect;
@@ -102,6 +103,13 @@ public void flashScrollIndicators() {
awakenScrollBars();
}
@Override
protected void onDraw(Canvas canvas) {
getDrawingRect(mRect);
canvas.clipRect(mRect);
super.onDraw(canvas);
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
MeasureSpecAssertions.assertExplicitMeasureSpec(widthMeasureSpec, heightMeasureSpec);

0 comments on commit d5465a9

Please sign in to comment.