Skip to content

Conversation

justinmc
Copy link
Contributor

Description

InteractiveViewer wasn't respecting the scaleEnabled parameter when scaling was done with a mouse.

Related Issues

Closes #59411

Tests

I added the following tests:

  • Test that scaling with the mouse works normally, and test that it doesn't work when scaleEnabled is false.

Breaking Change

None

@justinmc justinmc self-assigned this Jun 15, 2020
@fluttergithubbot fluttergithubbot added the framework flutter/packages/flutter repository. See also f: labels. label Jun 15, 2020
@justinmc justinmc requested a review from LongCatIsLooong June 15, 2020 16:20
Copy link
Contributor

@LongCatIsLooong LongCatIsLooong left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -659,13 +659,13 @@ class _InteractiveViewerState extends State<InteractiveViewer> with TickerProvid

// Returns true iff the given _GestureType is enabled.
bool _gestureIsSupported(_GestureType gestureType) {
if (_gestureType == _GestureType.pan && !widget.panEnabled) {
if (gestureType == _GestureType.pan && !widget.panEnabled) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: maybe use switch instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That seems simpler to me, will do 👍

Copy link
Contributor

Choose a reason for hiding this comment

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

I think using default clause is discouraged.

@fluttergithubbot fluttergithubbot merged commit b429ec1 into flutter:master Jun 16, 2020
@justinmc justinmc deleted the iv-disable-mouse-scale branch June 16, 2020 18:22
zljj0818 pushed a commit to zljj0818/flutter that referenced this pull request Jun 22, 2020
mingwandroid pushed a commit to mingwandroid/flutter that referenced this pull request Sep 6, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

InteractiveViewer ignores scaleEnabled on web
4 participants