Commit Graph

5 Commits

Author SHA1 Message Date
Joshua Gross c0e7e1bd9c Back out "Introducing LayoutableShadownode::getContentOriginOffset and use it in ScrollView"
Summary:
Original commit changeset: 6fd54661305a

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D22532594

fbshipit-source-id: 5ca25328cfe11416a9721a90611eff56e14cb49f
2020-07-14 19:03:13 -07:00
Samuel Susla 0060b5de55 Introducing LayoutableShadownode::getContentOriginOffset and use it in ScrollView
Summary:
Changelog: [Internal]

When calling "measure" on ScrollView's children, origin needs to be adjusted for ScrollView's content offset.
For this scrollView uses `getTransform` to adjust frames of its children.

This is wrong because transform is applied to ScrollView as well.

Example:
ScrollView is scrolled 900 points and its origin is {0, 0}, if you call "measure" on the ScrollView, our current measure infra will report its origin being {0, 900}.

Reviewed By: shergin

Differential Revision: D22456266

fbshipit-source-id: 6fd54661305ad46def8ece93fcf61d66817b3e01
2020-07-13 06:00:00 -07:00
Samuel Susla 40f37b986b Temporarily disable support for transformations in findNodeAtPoint infrastructure
Summary:
Changelog: [Internal]

FindNoteAtPoint takes transformations into account. There is however a problem with how transformation in ScrollView. In ScrollViewShadowNode, getTransform is overriden. In the override we apply `Transform::Translate(-contentOffset.x, -contentOffset.y, 0)`, this means that ScrollView has moved by {-x,-y}. However this is only true for its children, not for scroll view itself. This trips off findNodeAtPoint and if you scroll more than than screen's height, point will not be evaluated as inside ScrollView.

Until we can figure out how to deal with this properly, I think it is better to disable it as usage of JS Inspector is more common in ScrollViews than it is with transformed views.

Reviewed By: shergin

Differential Revision: D22332779

fbshipit-source-id: f48c9ae67a595e6954c2b70fb287db7f8c74378b
2020-07-02 12:29:22 -07:00
Samuel Susla 2394108e15 Fix FindNodeAtPoint newPoint calculation
Summary:
Changelog: [Internal]

Fix newPoint calculation. This bug was revealed when testing with JS inspector.

Reviewed By: JoshuaGross, shergin, mdvacca

Differential Revision: D20369654

fbshipit-source-id: d05aac5bbd408ef5bb0e8e92f0446e287d2854a0
2020-03-14 07:35:13 -07:00
Samuel Susla f96dc274d1 FindNodeAtPoint now accounts for scrollView offset
Summary:
Changelog: [internal]
FindNodeAtPoint was not taking transform into account.

Reviewed By: JoshuaGross

Differential Revision: D20288026

fbshipit-source-id: a8ff09bc265de983e42610c5d23837a2000f9dd2
2020-03-09 05:57:20 -07:00