mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-02-08 09:12:05 +08:00
Accept double args in ScrollView.scrollTo
Differential Revision: D2623473 fb-gh-sync-id: 8d4156e67f42d050f0f940d69ca534180d5a0b23
This commit is contained in:
committed by
facebook-github-bot-4
parent
201318f949
commit
df36e388f1
@@ -60,14 +60,14 @@ public class ReactScrollViewCommandHelper {
|
||||
Assertions.assertNotNull(args);
|
||||
switch (commandType) {
|
||||
case COMMAND_SCROLL_TO: {
|
||||
int destX = Math.round(PixelUtil.toPixelFromDIP(args.getInt(0)));
|
||||
int destY = Math.round(PixelUtil.toPixelFromDIP(args.getInt(1)));
|
||||
int destX = Math.round(PixelUtil.toPixelFromDIP(args.getDouble(0)));
|
||||
int destY = Math.round(PixelUtil.toPixelFromDIP(args.getDouble(1)));
|
||||
viewManager.scrollTo(scrollView, new ScrollToCommandData(destX, destY));
|
||||
return;
|
||||
}
|
||||
case COMMAND_SCROLL_WITHOUT_ANIMATION_TO: {
|
||||
int destX = Math.round(PixelUtil.toPixelFromDIP(args.getInt(0)));
|
||||
int destY = Math.round(PixelUtil.toPixelFromDIP(args.getInt(1)));
|
||||
int destX = Math.round(PixelUtil.toPixelFromDIP(args.getDouble(0)));
|
||||
int destY = Math.round(PixelUtil.toPixelFromDIP(args.getDouble(1)));
|
||||
viewManager.scrollWithoutAnimationTo(scrollView, new ScrollToCommandData(destX, destY));
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user