Skip to content

Commit

Permalink
Clean up remaining TextScaleFactor references
Browse files Browse the repository at this point in the history
  • Loading branch information
domesticmouse committed Feb 23, 2024
1 parent 6adab96 commit 9e601c2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions lib/src/ui/char_metrics.dart
Original file line number Diff line number Diff line change
@@ -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();
Expand Down
2 changes: 1 addition & 1 deletion lib/src/ui/paragraph_cache.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions test/src/terminal_view_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ void main() {
});
});

group('TerminalView.textScaleFactor', () {
group('TerminalView.textScaler', () {
testWidgets('works', (tester) async {
final terminal = Terminal();

Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 9e601c2

Please sign in to comment.