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
2021-05-09 16:08:37 -0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
7188779c98a41811644b8733d01c4b95e0d75804
7188779c
1 parent
eb715929
Improve TextStyle decoration merging
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
6 deletions
pdf/CHANGELOG.md
pdf/lib/src/widgets/text_style.dart
pdf/CHANGELOG.md
View file @
7188779
...
...
@@ -7,6 +7,7 @@
-
Add LinearProgressIndicator
-
Add PdfOutline.toString()
-
Add equality operator to PdfPageFormat
-
Improve TextStyle decoration merging
## 3.3.0
...
...
pdf/lib/src/widgets/text_style.dart
View file @
7188779
...
...
@@ -43,11 +43,6 @@ class TextDecoration {
final
int
_mask
;
/// Whether this decoration will paint at least as much decoration as the given decoration.
bool
contains
(
TextDecoration
other
)
{
return
(
_mask
|
other
.
_mask
)
==
_mask
;
}
/// Do not draw a decoration
static
const
TextDecoration
none
=
TextDecoration
.
_
(
0x0
);
...
...
@@ -60,6 +55,18 @@ class TextDecoration {
/// Draw a line through each line of text
static
const
TextDecoration
lineThrough
=
TextDecoration
.
_
(
0x4
);
TextDecoration
merge
(
TextDecoration
?
other
)
{
if
(
other
==
null
)
{
return
this
;
}
return
TextDecoration
.
_
(
_mask
|
other
.
_mask
);
}
/// Whether this decoration will paint at least as much decoration as the given decoration.
bool
contains
(
TextDecoration
other
)
{
return
(
_mask
|
other
.
_mask
)
==
_mask
;
}
@override
bool
operator
==(
dynamic
other
)
{
if
(
other
is
!
TextDecoration
)
{
...
...
@@ -340,7 +347,7 @@ class TextStyle {
lineSpacing:
other
.
lineSpacing
,
height:
other
.
height
,
background:
other
.
background
,
decoration:
other
.
decoration
,
decoration:
decoration
?.
merge
(
other
.
decoration
)
,
decorationColor:
other
.
decorationColor
,
decorationStyle:
other
.
decorationStyle
,
decorationThickness:
other
.
decorationThickness
,
...
...
Please
register
or
login
to post a comment