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
2019-04-06 06:26:29 -0400
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
320b5b8d84288682e7449776b3671c83a9e92156
320b5b8d
1 parent
05851354
Fix RichText Widget word spacing
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
5 deletions
pdf/CHANGELOG.md
pdf/lib/widgets/text.dart
pdf/CHANGELOG.md
View file @
320b5b8
...
...
@@ -3,6 +3,7 @@
*
Add Theme::copyFrom() method
*
Allow Annotations in TextSpan
*
Add SizedBox Widget
*
Fix RichText Widget word spacing
# 1.3.7
*
Add Pdf Creation date
...
...
pdf/lib/widgets/text.dart
View file @
320b5b8
...
...
@@ -183,7 +183,7 @@ class RichText extends Widget {
for
(
String
word
in
span
.
text
.
split
(
' '
))
{
if
(
word
.
isEmpty
)
{
offsetX
+=
space
.
width
;
offsetX
+=
space
.
advanceWidth
*
style
.
wordSpacing
;
continue
;
}
...
...
@@ -193,8 +193,12 @@ class RichText extends Widget {
if
(
offsetX
+
metrics
.
width
>
constraintWidth
&&
wCount
>
0
)
{
width
=
math
.
max
(
width
,
_realignLine
(
_words
.
sublist
(
lineStart
),
constraintWidth
,
offsetX
-
space
.
width
,
false
,
bottom
));
_realignLine
(
_words
.
sublist
(
lineStart
),
constraintWidth
,
offsetX
-
space
.
advanceWidth
*
style
.
wordSpacing
,
false
,
bottom
));
lineStart
+=
wCount
;
if
(
maxLines
!=
null
&&
++
lines
>
maxLines
)
{
break
;
...
...
@@ -219,10 +223,11 @@ class RichText extends Widget {
_words
.
add
(
wd
);
wCount
++;
offsetX
+=
metrics
.
width
+
space
.
advanceWidth
;
offsetX
+=
metrics
.
advanceWidth
+
space
.
advanceWidth
*
style
.
wordSpacing
;
}
offsetX
-=
space
.
width
;
offsetX
-=
space
.
advanceWidth
*
style
.
wordSpacing
;
return
true
;
});
...
...
Please
register
or
login
to post a comment