Browse Source

Clean up remaining `TextScaleFactor` references

Brett Morgan 1 year ago
parent
commit
9e601c2549

+ 3 - 2
lib/src/ui/char_metrics.dart

@@ -1,13 +1,14 @@
 import 'dart:ui';
 
+import 'package:flutter/painting.dart';
 import 'package:xterm/src/ui/terminal_text_style.dart';
 
-Size calcCharSize(TerminalStyle style, double textScaleFactor) {
+Size calcCharSize(TerminalStyle style, TextScaler textScaler) {
   const test = 'mmmmmmmmmm';
 
   final textStyle = style.toTextStyle();
   final builder = ParagraphBuilder(textStyle.getParagraphStyle());
-  builder.pushStyle(textStyle.getTextStyle(textScaleFactor: textScaleFactor));
+  builder.pushStyle(textStyle.getTextStyle(textScaler: textScaler));
   builder.addText(test);
 
   final paragraph = builder.build();

+ 1 - 1
lib/src/ui/paragraph_cache.dart

@@ -17,7 +17,7 @@ class ParagraphCache {
     return _cache[key];
   }
 
-  /// Applies [style] and [textScaleFactor] to [text] and lays it out to create
+  /// Applies [style] and [textScaler] to [text] and lays it out to create
   /// a [Paragraph]. The [Paragraph] is cached and can be retrieved with the
   /// same [key] by calling [getLayoutFromCache].
   Paragraph performAndCacheLayout(

+ 2 - 2
test/src/terminal_view_test.dart

@@ -306,7 +306,7 @@ void main() {
     });
   });
 
-  group('TerminalView.textScaleFactor', () {
+  group('TerminalView.textScaler', () {
     testWidgets('works', (tester) async {
       final terminal = Terminal();
 
@@ -345,7 +345,7 @@ void main() {
       );
     });
 
-    testWidgets('can obtain textScaleFactor from parent', (tester) async {
+    testWidgets('can obtain textScaler from parent', (tester) async {
       final terminal = Terminal();
 
       await tester.pumpWidget(