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