Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ScaleGestureRecognizer: make pointerCount public #127310

Merged
merged 1 commit into from
Sep 12, 2023
Merged

ScaleGestureRecognizer: make pointerCount public #127310

merged 1 commit into from
Sep 12, 2023

Conversation

kseino
Copy link
Contributor

@kseino kseino commented May 22, 2023

make pointCount in ScaleGestureRecognizer public to handle pointer event depending on the number of pointers.

#127309

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@flutter-dashboard flutter-dashboard bot added f: gestures flutter/packages/flutter/gestures repository. framework flutter/packages/flutter repository. See also f: labels. labels May 22, 2023
@Renzo-Olivares
Copy link
Contributor

Hi @kseino, thank you for the contribution! I have read through your proposal but I don't completely understand the use-case for this. Is there some functionality that pointerCount provided by ScaleStartDetails/ScaleUpdateDetails/ScaleEndDetails does not allow you to accomplish?

Would something like this work?

void onScaleStart(ScaleStartDetails details) {
    if (details.pointerCount == 2) {
        // Some logic.
    }
}

@goderbauer
Copy link
Member

(Triage) @kseino Do you still have plans to follow up on the feedback given above?

@kseino
Copy link
Contributor Author

kseino commented Jul 10, 2023

@Renzo-Olivares @goderbauer
sorry for the late reply, I was on vacation.

we need to call resolve or reject by pointCount in handleEvent instead of ScaleStartDetails/ScaleUpdateDetails/ScaleEndDetails

class CustomScaleGestureRecognizer extends ScaleGestureRecognizer {
  @override
  void handleEvent(PointerEvent event) {
    super.handleEvent(event);
    if (pointerCount == 2) {
      // resolve or reject
    }
  }
}

if this is not a common use case, I think this PR will be closed..

@Renzo-Olivares
Copy link
Contributor

@kseino, so the use-case is that you would like a way to resolve/reject a scale gesture based on the number of pointers? For example reject a 4-pointer scale. If so, this sounds like a reasonable change to me, and we already expose pointerCount publicly through the details objects.

@kseino
Copy link
Contributor Author

kseino commented Jul 21, 2023

@Renzo-Olivares

@kseino, so the use-case is that you would like a way to resolve/reject a scale gesture based on the number of pointers?

yes, that is exactly what we want!

@Piinks
Copy link
Contributor

Piinks commented Aug 15, 2023

Since this is already supported, should we close this PR? In the test cases, the pointer count is already available through the Scale*Details objects as @Renzo-Olivares pointed out.

@kseino
Copy link
Contributor Author

kseino commented Aug 16, 2023

@Piinks
we want know the pointer count in handleEvent method, but this is not supported..

@Piinks
Copy link
Contributor

Piinks commented Aug 16, 2023

we want know the pointer count in handleEvent method, but this is not supported..

Oh I think I see... This case only provides the PointerEvent

Copy link
Contributor

@Piinks Piinks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flutter_LGTM

@Piinks
Copy link
Contributor

Piinks commented Sep 11, 2023

@Renzo-Olivares would you be able to give second approval for this?

@Piinks Piinks added the autosubmit Merge PR when tree becomes green via auto submit App label Sep 11, 2023
@auto-submit auto-submit bot merged commit 82cb749 into flutter:master Sep 12, 2023
67 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 12, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 12, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 12, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 12, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 12, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 12, 2023
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Sep 12, 2023
flutter/flutter@219efce...4e7a07a

2023-09-12 [email protected] Remove chip tooltip deprecations (flutter/flutter#134486)
2023-09-12 [email protected] Roll Flutter Engine from 8a8ddaeecf8a to d4698c65aa8d (2 revisions) (flutter/flutter#134553)
2023-09-12 [email protected] Remove deprecated TextSelectionOverlay.fadeDuration (flutter/flutter#134485)
2023-09-12 [email protected] Roll Flutter Engine from 25be03186d82 to 8a8ddaeecf8a (1 revision) (flutter/flutter#134545)
2023-09-12 [email protected] Roll Packages from ef0c65e to e04ba88 (5 revisions) (flutter/flutter#134546)
2023-09-12 47866232 [email protected] Revert "Adds a parent scope TraversalEdgeBehavior and fixes modal rouâ�¦ (flutter/flutter#134550)
2023-09-12 [email protected] Marks Windows_android channels_integration_test_win to be unflaky (flutter/flutter#133129)
2023-09-12 [email protected] Roll Flutter Engine from 4091167e402d to 25be03186d82 (1 revision) (flutter/flutter#134536)
2023-09-12 [email protected] Roll Flutter Engine from 54175da7ba90 to 4091167e402d (1 revision) (flutter/flutter#134532)
2023-09-12 [email protected] Roll Flutter Engine from 85f3f02e5c37 to 54175da7ba90 (2 revisions) (flutter/flutter#134531)
2023-09-12 [email protected] Roll Flutter Engine from 1369ab35aaa7 to 85f3f02e5c37 (1 revision) (flutter/flutter#134519)
2023-09-12 [email protected] Roll Flutter Engine from 2f1efe5967f3 to 1369ab35aaa7 (1 revision) (flutter/flutter#134512)
2023-09-12 [email protected] Roll Flutter Engine from 4d8265cbc133 to 2f1efe5967f3 (3 revisions) (flutter/flutter#134511)
2023-09-12 [email protected] Roll Flutter Engine from ee7215553deb to 4d8265cbc133 (1 revision) (flutter/flutter#134506)
2023-09-12 [email protected] Roll Flutter Engine from 6ddee4423d2c to ee7215553deb (2 revisions) (flutter/flutter#134505)
2023-09-12 [email protected] Roll Flutter Engine from a98348946d61 to 6ddee4423d2c (1 revision) (flutter/flutter#134490)
2023-09-12 [email protected] [New feature] Allowing the `ListView` slivers to have different extents while still having scrolling performance (flutter/flutter#131393)
2023-09-12 [email protected] Roll Flutter Engine from 8389ad914b21 to a98348946d61 (4 revisions) (flutter/flutter#134487)
2023-09-12 [email protected] ScaleGestureRecognizer: make pointerCount public (flutter/flutter#127310)
2023-09-11 [email protected] Fix DataTable example not being scrollable (flutter/flutter#131556)
2023-09-11 [email protected] Roll Flutter Engine from 06696e768c1b to 8389ad914b21 (2 revisions) (flutter/flutter#134469)
2023-09-11 [email protected] [flutter_tools] disallow -O0 for flutter build web (flutter/flutter#134185)
2023-09-11 [email protected] Cover focus tests with leak tracking (flutter/flutter#134457)
2023-09-11 [email protected] Roll Flutter Engine from 0774ddcda9b0 to 06696e768c1b (4 revisions) (flutter/flutter#134462)
2023-09-11 [email protected] Fix memory leak in RenderAnimatedSize (flutter/flutter#133653)
2023-09-11 [email protected] Roll Flutter Engine from e42fd367adcb to 0774ddcda9b0 (1 revision) (flutter/flutter#134447)
2023-09-11 [email protected] Roll Flutter Engine from d593002b7159 to e42fd367adcb (1 revision) (flutter/flutter#134444)
2023-09-11 [email protected] Roll Packages from aaae5ef to ef0c65e (6 revisions) (flutter/flutter#134445)
2023-09-11 [email protected] Roll Flutter Engine from 2b5961cbc40d to d593002b7159 (3 revisions) (flutter/flutter#134439)
2023-09-11 [email protected] Mark leak: instances of OpacityLayer, created by _RenderChip, should be disposed. (flutter/flutter#134395)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/ doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App f: gestures flutter/packages/flutter/gestures repository. framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants