David PHAM-VAN

Fix Text.softWrap behavior

# Changelog
## 3.3.1
- Fix Text.softWrap behavior
## 3.3.0
- Implement To be signed flieds
... ...
... ... @@ -699,7 +699,8 @@ class RichText extends Widget with SpanningWidget {
(style.fontSize! * textScaleFactor)) *
(style.fontSize! * textScaleFactor);
if (offsetX + metrics.width > constraintWidth + 0.00001) {
if (_softWrap &&
offsetX + metrics.width > constraintWidth + 0.00001) {
if (spanCount > 0 && metrics.width <= constraintWidth) {
overflow = true;
lines.add(_Line(
... ... @@ -775,7 +776,7 @@ class RichText extends Widget with SpanningWidget {
style.letterSpacing!;
}
if (_softWrap && line < spanLines.length - 1) {
if (line < spanLines.length - 1) {
lines.add(_Line(
this,
spanStart,
... ...
... ... @@ -4,7 +4,7 @@ description: A pdf producer for Dart. It can create pdf files for both web or fl
homepage: https://github.com/DavBfr/dart_pdf/tree/master/pdf
repository: https://github.com/DavBfr/dart_pdf
issue_tracker: https://github.com/DavBfr/dart_pdf/issues
version: 3.3.0
version: 3.3.1
environment:
sdk: ">=2.12.0-0 <3.0.0"
... ...
... ... @@ -63,7 +63,10 @@ void main() {
});
test('Text Widgets softWrap', () {
pdf.addPage(MultiPage(
final para = LoremText().paragraph(40);
pdf.addPage(
MultiPage(
build: (Context context) => <Widget>[
Text(
'Text with\nsoft wrap\nenabled',
... ... @@ -73,7 +76,23 @@ void main() {
'Text with\nsoft wrap\ndisabled',
softWrap: false,
),
]));
SizedBox(
width: 120,
child: Text(
para,
softWrap: false,
),
),
SizedBox(
width: 120,
child: Text(
para,
softWrap: true,
),
),
],
),
);
});
test('Text Widgets Alignement', () {
... ... @@ -85,7 +104,6 @@ void main() {
Text(
'$align:\n' + para,
textAlign: align,
softWrap: true,
),
);
}
... ...