fix(main-editor): fix problem where onLayerTapUp is never called
#716
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Checklist (Required)
Please ensure your PR meets the following requirements:
dart format .in the terminal and committed any changes.dart analyze .in the terminal and addressed any issues.flutter testin the terminal and addressed any issues.CHANGELOG.mdfile with my changes (For the version, you can use X.X.X, I will later bump it after it's merged).feat(paint-editor): add new triangle shape).PR Checklist (Optional)
PR Type
Please indicate the types of changes this PR introduces by checking the relevant boxes:
Current Behavior
When the user finish action with a layer (drag or scale, etc),
onLayerTapUpcallback should be called, but currently isn't because handleTapUp checks forisLayerBeingTransformed. Please refer toAdditional Informationfor my reasoning.Issue Number: N/A
New Behavior
Remove
isLayerBeingTransformedcheck, which seems to be unnecessary?Breaking Changes?
Does this PR introduce a breaking change?
Additional Information
I did a bit of looking and found that handleTapUp has the
isLayerBeingTransformedcheck. As of right now the only place whereisLayerBeingTransformedbecomesfalseis at _onScaleEnd. One problem is that_onScaleEndis always called afterhandleTapUp, which means that currently there's no case thatisLayerBeingTransformedwould betrueby the time the check takes place, which leads toonLayerTapUpnever being called.What lead me to think that this check is unnecessary is that the check also check for
_isScaleInteractionActiveand thatisLayerBeingTransformedis only trigger on/off in the scale operation.However, I'm not very confident that this is the fix so if this doesn't make sense, please feel free to close this PR