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
2020-12-30 17:41:15 -0400
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
381c2b115c2b2f3f153c9e77783274c015720bfd
381c2b11
1 parent
0a04a277
Improve BoxBorder correctness
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
2 deletions
pdf/CHANGELOG.md
pdf/lib/src/pdf/graphics.dart
pdf/lib/src/svg/path.dart
pdf/lib/src/widgets/box_border.dart
test/golden/widgets-svg.pdf
pdf/CHANGELOG.md
View file @
381c2b1
...
...
@@ -12,6 +12,7 @@
-
Document.save() now returns a Future
-
Add Widget.draw() to paint any widget on a canvas
-
Improve Chart labels
-
Improve BoxBorder correctness
## 1.13.0
...
...
pdf/lib/src/pdf/graphics.dart
View file @
381c2b1
...
...
@@ -582,6 +582,7 @@ class PdfGraphics {
/// Set line joint miter limit, applies if the
void
setMiterLimit
(
double
limit
)
{
assert
(
limit
>=
1.0
);
PdfNum
(
limit
).
output
(
buf
);
buf
.
putString
(
' M
\n
'
);
}
...
...
pdf/lib/src/svg/path.dart
View file @
381c2b1
...
...
@@ -14,6 +14,8 @@
* limitations under the License.
*/
import
'dart:math'
as
math
;
import
'package:pdf/pdf.dart'
;
import
'package:xml/xml.dart'
;
...
...
@@ -225,7 +227,7 @@ class SvgPath extends SvgOperation {
..
drawShape
(
d
)
..
setLineCap
(
brush
.
strokeLineCap
)
..
setLineJoin
(
brush
.
strokeLineJoin
)
..
setMiterLimit
(
brush
.
strokeMiterLimit
)
..
setMiterLimit
(
math
.
max
(
1.0
,
brush
.
strokeMiterLimit
)
)
..
setLineDashPattern
(
brush
.
strokeDashArray
,
brush
.
strokeDashOffset
.
toInt
())
..
setLineWidth
(
brush
.
strokeWidth
.
sizeValue
)
...
...
pdf/lib/src/widgets/box_border.dart
View file @
381c2b1
...
...
@@ -87,6 +87,8 @@ abstract class BoxBorder {
BorderSide
side
,
BorderRadius
borderRadius
)
{
_setStyle
(
context
,
side
.
style
);
context
.
canvas
..
setLineJoin
(
PdfLineJoin
.
miter
)
..
setMiterLimit
(
4
)
..
setStrokeColor
(
side
.
color
)
..
setLineWidth
(
side
.
width
);
borderRadius
.
paint
(
context
,
box
);
...
...
@@ -98,6 +100,8 @@ abstract class BoxBorder {
Context
context
,
PdfRect
box
,
BorderSide
side
)
{
_setStyle
(
context
,
side
.
style
);
context
.
canvas
..
setLineJoin
(
PdfLineJoin
.
miter
)
..
setMiterLimit
(
4
)
..
setStrokeColor
(
side
.
color
)
..
setLineWidth
(
side
.
width
)
..
drawBox
(
box
)
...
...
@@ -254,7 +258,10 @@ class Border extends BoxBorder {
assert
(
borderRadius
==
null
,
'A borderRadius can only be given for a uniform Border.'
);
context
.
canvas
.
setLineCap
(
PdfLineCap
.
square
);
context
.
canvas
..
setLineCap
(
PdfLineCap
.
square
)
..
setMiterLimit
(
4
)
..
setLineJoin
(
PdfLineJoin
.
miter
);
if
(
top
.
style
!=
BorderStyle
.
none
)
{
BoxBorder
.
_setStyle
(
context
,
top
.
style
);
...
...
test/golden/widgets-svg.pdf
View file @
381c2b1
No preview for this file type
Please
register
or
login
to post a comment