mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-02 20:13:50 +08:00
fixes for text box
This commit is contained in:
@ -1,7 +1,6 @@
|
||||
import 'dart:ui';
|
||||
import 'dart:math' as math;
|
||||
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter/widgets.dart' as widgets;
|
||||
|
||||
import 'component.dart';
|
||||
import 'resizable.dart';
|
||||
@ -52,7 +51,7 @@ class TextBoxComponent extends PositionComponent with Resizable {
|
||||
_lines = [''];
|
||||
text.split(' ').forEach((word) {
|
||||
String possibleLine = _lines.last + ' ' + word;
|
||||
TextPainter p = config.toTextPainter(possibleLine);
|
||||
widgets.TextPainter p = config.toTextPainter(possibleLine);
|
||||
if (_lineHeight == null) {
|
||||
_lineHeight = p.height;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user