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-01-25 10:19:37 -0500
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ca2ef029ddfc01a279f940adbbe54b0c7f12cd7d
ca2ef029
1 parent
f13cd8c2
Fix drawShape Bézier curves
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
8 deletions
pdf/CHANGELOG.md
pdf/lib/src/graphics.dart
pdf/CHANGELOG.md
View file @
ca2ef02
# 1.1.1
*
Improve PdfPoint and PdfRect
*
Change PdfColor.fromInt to const constructor
*
Fix drawShape Bézier curves
# 1.1.0
*
Rename classes to satisfy Dart conventions
...
...
pdf/lib/src/graphics.dart
View file @
ca2ef02
...
...
@@ -278,10 +278,10 @@ class PdfGraphics {
break
;
case
'C'
:
// cubic bezier, absolute
var
len
=
0
;
while
(
(
len
+
1
)
*
6
<=
points
.
length
)
{
while
(
len
<
points
.
length
)
{
curveTo
(
points
[
len
+
0
],
points
[
len
+
1
],
points
[
len
+
2
],
points
[
len
+
3
],
points
[
len
+
4
],
points
[
len
+
5
]);
len
+=
1
;
len
+=
6
;
}
lastPoint
=
PdfPoint
(
points
[
points
.
length
-
2
],
points
[
points
.
length
-
1
]);
...
...
@@ -307,7 +307,7 @@ class PdfGraphics {
break
;
case
'c'
:
// cubic bezier, relative
var
len
=
0
;
while
(
(
len
+
1
)
*
6
<=
points
.
length
)
{
while
(
len
<
points
.
length
)
{
points
[
len
+
0
]
+=
lastPoint
.
x
;
points
[
len
+
1
]
+=
lastPoint
.
y
;
points
[
len
+
2
]
+=
lastPoint
.
x
;
...
...
@@ -316,12 +316,10 @@ class PdfGraphics {
points
[
len
+
5
]
+=
lastPoint
.
y
;
curveTo
(
points
[
len
+
0
],
points
[
len
+
1
],
points
[
len
+
2
],
points
[
len
+
3
],
points
[
len
+
4
],
points
[
len
+
5
]);
len
+=
1
;
lastPoint
=
PdfPoint
(
points
[
len
+
4
],
points
[
len
+
5
]);
lastControl
=
PdfPoint
(
points
[
len
+
2
],
points
[
len
+
3
]);
len
+=
6
;
}
lastPoint
=
PdfPoint
(
points
[
points
.
length
-
2
],
points
[
points
.
length
-
1
]);
lastControl
=
PdfPoint
(
points
[
points
.
length
-
4
],
points
[
points
.
length
-
3
]);
break
;
case
's'
:
// smooth cubic bézier, relative
while
(
points
.
length
>=
4
)
{
...
...
Please
register
or
login
to post a comment