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-02-26 16:59:46 -0500
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ceccb03447aed004160dee8f58b3302c2b93e96a
ceccb034
1 parent
2930194e
Fix a bug with the RichText Widget
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
7 deletions
pdf/CHANGELOG.md
pdf/lib/widgets/table.dart
pdf/lib/widgets/text.dart
pdf/pubspec.yaml
pdf/CHANGELOG.md
View file @
ceccb03
# 1.3.3
*
Fix a bug with the RichText Widget
# 1.3.2
*
Fix dart lint warnings
*
Improve font bounds calculation
...
...
pdf/lib/widgets/table.dart
View file @
ceccb03
...
...
@@ -165,8 +165,9 @@ class Table extends Widget implements SpanningWidget {
child
.
layout
(
context
,
const
BoxConstraints
());
final
double
calculatedWidth
=
child
.
box
.
width
==
double
.
infinity
?
0.0
:
child
.
box
.
width
;
final
double
childFlex
=
child
is
Expanded
?
child
.
flex
.
toDouble
()
:
0.0
;
final
double
childFlex
=
child
is
Expanded
?
child
.
flex
.
toDouble
()
:
(
child
.
box
.
width
==
double
.
infinity
?
1.0
:
0.0
);
if
(
flex
.
length
<
n
+
1
)
{
flex
.
add
(
childFlex
);
_widths
.
add
(
calculatedWidth
);
...
...
@@ -280,7 +281,13 @@ class Table extends Widget implements SpanningWidget {
continue
;
}
for
(
Widget
child
in
row
.
children
)
{
context
.
canvas
..
saveContext
()
..
drawRect
(
child
.
box
.
x
,
child
.
box
.
y
,
child
.
box
.
width
,
child
.
box
.
height
)
..
clipPath
();
child
.
paint
(
context
);
context
.
canvas
.
restoreContext
();
}
if
(
index
>=
_context
.
lastLine
)
{
break
;
...
...
pdf/lib/widgets/text.dart
View file @
ceccb03
...
...
@@ -186,10 +186,7 @@ class RichText extends Widget {
final
PdfFontMetrics
metrics
=
font
.
stringMetrics
(
word
)
*
(
style
.
fontSize
*
textScaleFactor
);
if
(
offsetX
+
metrics
.
width
>
constraintWidth
)
{
if
(
wCount
==
0
)
{
break
;
}
if
(
offsetX
+
metrics
.
width
>
constraintWidth
&&
wCount
>
0
)
{
width
=
math
.
max
(
width
,
_realignLine
(
_words
.
sublist
(
lineStart
),
constraintWidth
,
...
...
@@ -229,6 +226,10 @@ class RichText extends Widget {
width
,
_realignLine
(
_words
.
sublist
(
lineStart
),
constraintWidth
,
offsetX
,
true
,
bottom
));
bottom
??=
0.0
;
top
??=
0.0
;
box
=
PdfRect
(
0.0
,
0.0
,
constraints
.
constrainWidth
(
width
),
constraints
.
constrainHeight
(
offsetY
+
bottom
-
top
));
}
...
...
pdf/pubspec.yaml
View file @
ceccb03
...
...
@@ -2,7 +2,7 @@ name: pdf
author
:
David PHAM-VAN <dev.nfet.net@gmail.com>
description
:
A pdf producer for Dart. It can create pdf files for both web or flutter.
homepage
:
https://github.com/DavBfr/dart_pdf/tree/master/pdf
version
:
1.3.
2
version
:
1.3.
3
environment
:
sdk
:
"
>=1.8.0
<3.0.0"
...
...
Please
register
or
login
to post a comment