get pixel ratio from view (#1259)

pull/1262/head
Pwiz 2 years ago committed by GitHub
parent ebef9d7d95
commit ba6fa9c6f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      lib/src/widgets/editor.dart
  2. 2
      lib/src/widgets/raw_editor.dart
  3. 2
      lib/src/widgets/text_block.dart

@ -477,8 +477,8 @@ class QuillEditorState extends State<QuillEditor>
selectionColor = selectionTheme.selectionColor ?? selectionColor = selectionTheme.selectionColor ??
cupertinoTheme.primaryColor.withOpacity(0.40); cupertinoTheme.primaryColor.withOpacity(0.40);
cursorRadius ??= const Radius.circular(2); cursorRadius ??= const Radius.circular(2);
cursorOffset = Offset( cursorOffset =
iOSHorizontalOffset / MediaQuery.of(context).devicePixelRatio, 0); Offset(iOSHorizontalOffset / View.of(context).devicePixelRatio, 0);
} else { } else {
textSelectionControls = materialTextSelectionControls; textSelectionControls = materialTextSelectionControls;
paintCursorAboveText = false; paintCursorAboveText = false;

@ -968,7 +968,7 @@ class RawEditorState extends EditorState
widget.selectionColor, widget.selectionColor,
widget.enableInteractiveSelection, widget.enableInteractiveSelection,
_hasFocus, _hasFocus,
MediaQuery.of(context).devicePixelRatio, View.of(context).devicePixelRatio,
_cursorCont); _cursorCont);
return editableTextLine; return editableTextLine;
} }

@ -159,7 +159,7 @@ class EditableTextBlock extends StatelessWidget {
color, color,
enableInteractiveSelection, enableInteractiveSelection,
hasFocus, hasFocus,
MediaQuery.of(context).devicePixelRatio, View.of(context).devicePixelRatio,
cursorCont); cursorCont);
final nodeTextDirection = getDirectionOfNode(line); final nodeTextDirection = getDirectionOfNode(line);
children.add(Directionality( children.add(Directionality(

Loading…
Cancel
Save