Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
dart_pdf
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
David PHAM-VAN
2021-04-28 06:12:57 -0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
9d95badbf489f2750040368082bc9ea7eed00bc6
9d95badb
1 parent
c6806bd1
Fix Text.softWrap behavior
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
6 deletions
pdf/CHANGELOG.md
pdf/lib/src/widgets/text.dart
pdf/pubspec.yaml
pdf/test/widget_text_test.dart
test/golden/widgets-text.pdf
pdf/CHANGELOG.md
View file @
9d95bad
# Changelog
## 3.3.1
-
Fix Text.softWrap behavior
## 3.3.0
-
Implement To be signed flieds
...
...
pdf/lib/src/widgets/text.dart
View file @
9d95bad
...
...
@@ -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
,
...
...
pdf/pubspec.yaml
View file @
9d95bad
...
...
@@ -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"
...
...
pdf/test/widget_text_test.dart
View file @
9d95bad
...
...
@@ -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
\n
soft wrap
\n
enabled'
,
...
...
@@ -73,7 +76,23 @@ void main() {
'Text with
\n
soft wrap
\n
disabled'
,
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
,
),
);
}
...
...
test/golden/widgets-text.pdf
View file @
9d95bad
No preview for this file type
Please
register
or
login
to post a comment