Skip to content

Commit

Permalink
Not show/update/hiden mangnifier when manifier config is disbale (#2212)
Browse files Browse the repository at this point in the history
* [chore]: change gesture

* [chore]: change gesture

* [chore]: code fromatter

* [chore]: remove code

* [chore]: add code commentary

* [chore] : not show/update/hiden mangnifier when manifier config is  disbale

---------

Co-authored-by: xuyang <[email protected]>
  • Loading branch information
demoYang and xuyang authored Sep 12, 2024
1 parent 02065c6 commit ea28228
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/src/editor/widgets/text/text_selection.dart
Original file line number Diff line number Diff line change
Expand Up @@ -382,18 +382,21 @@ class EditorTextSelectionOverlay {
}

void _onHandleDragStart(DragStartDetails details, TextPosition position) {
if (magnifierConfiguration == TextMagnifierConfiguration.disabled) return;
if (defaultTargetPlatform != TargetPlatform.iOS &&
defaultTargetPlatform != TargetPlatform.android) return;
showMagnifier(position, details.globalPosition, renderObject);
}

void _onHandleDragUpdate(DragUpdateDetails details, TextPosition position) {
if (magnifierConfiguration == TextMagnifierConfiguration.disabled) return;
if (defaultTargetPlatform != TargetPlatform.iOS &&
defaultTargetPlatform != TargetPlatform.android) return;
updateMagnifier(position, details.globalPosition, renderObject);
}

void _onHandleDragEnd(DragEndDetails details) {
if (magnifierConfiguration == TextMagnifierConfiguration.disabled) return;
if (defaultTargetPlatform != TargetPlatform.iOS &&
defaultTargetPlatform != TargetPlatform.android) return;
hideMagnifier();
Expand Down

0 comments on commit ea28228

Please sign in to comment.