diff --git a/lib/src/ui/char_metrics.dart b/lib/src/ui/char_metrics.dart index d7d3710..e35439d 100644 --- a/lib/src/ui/char_metrics.dart +++ b/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(); diff --git a/lib/src/ui/paragraph_cache.dart b/lib/src/ui/paragraph_cache.dart index 1dfd4ba..80896a0 100644 --- a/lib/src/ui/paragraph_cache.dart +++ b/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( diff --git a/test/src/terminal_view_test.dart b/test/src/terminal_view_test.dart index f9e7660..0540e09 100644 --- a/test/src/terminal_view_test.dart +++ b/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(