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-27 12:09:48 -0500
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
64227a39f14eaf39bc2e8ecbd3538830667a5410
64227a39
1 parent
3bf409ce
Improve PdfPoint and PdfRect
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
1 deletions
pdf/CHANGELOG.md
pdf/lib/src/point.dart
pdf/lib/src/rect.dart
pdf/pubspec.yaml
pdf/CHANGELOG.md
View file @
64227a3
# 1.1.1
*
Improve PdfPoint and PdfRect
# 1.1.0
*
Rename classes to satisfy Dart conventions
*
Remove useless new and const keywords
...
...
pdf/lib/src/point.dart
View file @
64227a3
...
...
@@ -30,6 +30,8 @@ class PdfPoint {
const
PdfPoint
(
this
.
x
,
this
.
y
);
static
const
zero
=
PdfPoint
(
0.0
,
0.0
);
@override
String
toString
()
=>
"PdfPoint(
$x
,
$y
)"
;
}
...
...
pdf/lib/src/rect.dart
View file @
64227a3
...
...
@@ -22,6 +22,8 @@ part of pdf;
class
PdfRect
{
final
double
x
,
y
,
w
,
h
;
static
const
zero
=
PdfRect
(
0.0
,
0.0
,
0.0
,
0.0
);
const
PdfRect
(
this
.
x
,
this
.
y
,
this
.
w
,
this
.
h
);
factory
PdfRect
.
fromLTRB
(
...
...
@@ -29,6 +31,10 @@ class PdfRect {
return
PdfRect
(
left
,
top
,
right
-
left
,
bottom
-
top
);
}
factory
PdfRect
.
fromPoints
(
PdfPoint
offset
,
PdfPoint
size
)
{
return
PdfRect
(
offset
.
x
,
offset
.
y
,
size
.
x
,
size
.
y
);
}
double
get
l
=>
x
;
double
get
b
=>
y
;
double
get
r
=>
x
+
w
;
...
...
@@ -36,4 +42,16 @@ class PdfRect {
@override
String
toString
()
=>
"PdfRect(
$x
,
$y
,
$w
,
$h
)"
;
PdfRect
operator
*(
double
factor
)
{
return
PdfRect
(
x
*
factor
,
y
*
factor
,
w
*
factor
,
h
*
factor
);
}
PdfPoint
get
offset
=>
PdfPoint
(
x
,
y
);
PdfPoint
get
size
=>
PdfPoint
(
w
,
h
);
PdfPoint
get
topLeft
=>
PdfPoint
(
x
,
y
);
PdfPoint
get
topRight
=>
PdfPoint
(
r
,
y
);
PdfPoint
get
bottomLeft
=>
PdfPoint
(
x
,
t
);
PdfPoint
get
bottomRight
=>
PdfPoint
(
r
,
t
);
}
...
...
pdf/pubspec.yaml
View file @
64227a3
...
...
@@ -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.1.
0
version
:
1.1.
1
environment
:
sdk
:
"
>=1.8.0
<3.0.0"
...
...
Please
register
or
login
to post a comment