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
Joseph Grabinger
2023-03-08 10:30:38 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
GitHub
2023-03-08 05:30:38 -0400
Commit
4a0cc3aed4ef72ba6ba48f9c99b9198b7219cf80
4a0cc3ae
1 parent
31dd7fdb
Apply BoxShape and BorderRadius to selected Checkbox (#1285)
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
pdf/lib/src/widgets/forms.dart
pdf/lib/src/widgets/forms.dart
View file @
4a0cc3a
...
...
@@ -14,6 +14,7 @@
* limitations under the License.
*/
import
'dart:math'
as
math
;
import
'dart:typed_data'
;
import
'package:vector_math/vector_math_64.dart'
;
...
...
@@ -81,7 +82,10 @@ class Checkbox extends SingleChildWidget {
double
width
=
13
,
double
height
=
13
,
BoxDecoration
?
decoration
,
})
:
super
(
})
:
radius
=
decoration
?.
shape
==
BoxShape
.
circle
?
Radius
.
circular
(
math
.
max
(
height
,
width
)/
2
)
:
decoration
?.
borderRadius
?.
topLeft
??
Radius
.
zero
,
super
(
child:
Container
(
width:
width
,
height:
height
,
...
...
@@ -103,6 +107,8 @@ class Checkbox extends SingleChildWidget {
final
String
name
;
final
Radius
radius
;
@override
void
paint
(
Context
context
)
{
super
.
paint
(
context
);
...
...
@@ -118,7 +124,7 @@ class Checkbox extends SingleChildWidget {
final
g
=
bf
.
appearance
(
context
.
document
,
PdfAnnotAppearance
.
normal
,
name:
'/Yes'
,
selected:
value
);
g
.
drawR
ect
(
0
,
0
,
bf
.
rect
.
width
,
bf
.
rect
.
height
);
g
.
drawR
Rect
(
0
,
0
,
bf
.
rect
.
width
,
bf
.
rect
.
height
,
radius
.
y
,
radius
.
x
);
g
.
setFillColor
(
activeColor
);
g
.
fillPath
();
g
.
moveTo
(
2
,
bf
.
rect
.
height
/
2
);
...
...
Please
register
or
login
to post a comment