@@ -120,8 +120,8 @@ class Padding extends SingleChildWidget {
120
120
final resolvedPadding = padding.resolve (Directionality .of (context));
121
121
if (child != null ) {
122
122
final mat = Matrix4 .identity ();
123
- mat.translate (box! .left + resolvedPadding.left,
124
- box! .bottom + resolvedPadding.bottom);
123
+ mat.translateByDouble (box! .left + resolvedPadding.left,
124
+ box! .bottom + resolvedPadding.bottom, 0 , 1 );
125
125
context.canvas
126
126
..saveContext ()
127
127
..setTransform (mat);
@@ -203,21 +203,21 @@ class Transform extends SingleChildWidget {
203
203
Matrix4 _effectiveTransform (Context context) {
204
204
final result = Matrix4 .identity ();
205
205
if (origin != null ) {
206
- result.translate (origin! .x, origin! .y);
206
+ result.translateByDouble (origin! .x, origin! .y, 0 , 1 );
207
207
}
208
- result.translate (box! .left, box! .bottom);
208
+ result.translateByDouble (box! .left, box! .bottom, 0 , 1 );
209
209
late PdfPoint translation;
210
210
if (alignment != null ) {
211
211
final resolvedAlignment = alignment! .resolve (Directionality .of (context));
212
212
translation = resolvedAlignment.alongSize (box! .size);
213
- result.translate (translation.x, translation.y);
213
+ result.translateByDouble (translation.x, translation.y, 0 , 1 );
214
214
}
215
215
result.multiply (transform);
216
216
if (alignment != null ) {
217
- result.translate (- translation.x, - translation.y);
217
+ result.translateByDouble (- translation.x, - translation.y, 0 , 1 );
218
218
}
219
219
if (origin != null ) {
220
- result.translate (- origin! .x, - origin! .y);
220
+ result.translateByDouble (- origin! .x, - origin! .y, 0 , 1 );
221
221
}
222
222
return result;
223
223
}
@@ -269,7 +269,7 @@ class Transform extends SingleChildWidget {
269
269
dy,
270
270
);
271
271
272
- transform.leftTranslate (dx, dy);
272
+ transform.leftTranslateByDouble (dx, dy, 0 , 1 );
273
273
} else {
274
274
box = PdfRect .fromPoints (PdfPoint .zero, constraints.smallest);
275
275
}
@@ -503,8 +503,8 @@ class FittedBox extends SingleChildWidget {
503
503
504
504
final mat = Matrix4 .translationValues (
505
505
destinationRect.left, destinationRect.bottom, 0 )
506
- ..scale (scaleX, scaleY, 1 )
507
- ..translate (- sourceRect.left, - sourceRect.bottom);
506
+ ..scaleByDouble (scaleX, scaleY, 1 , 1 )
507
+ ..translateByDouble (- sourceRect.left, - sourceRect.bottom, 0 , 1 );
508
508
509
509
context.canvas
510
510
..saveContext ()
@@ -610,7 +610,7 @@ class CustomPaint extends SingleChildWidget {
610
610
super .paint (context);
611
611
612
612
final mat = Matrix4 .identity ();
613
- mat.translate (box! .left, box! .bottom);
613
+ mat.translateByDouble (box! .left, box! .bottom, 0 , 1 );
614
614
context.canvas
615
615
..saveContext ()
616
616
..setTransform (mat);
@@ -776,7 +776,7 @@ class FullPage extends SingleChildWidget {
776
776
777
777
final box = _getBox (context);
778
778
final mat = Matrix4 .tryInvert (context.canvas.getTransform ())! ;
779
- mat.translate (box.left, box.bottom);
779
+ mat.translateByDouble (box.left, box.bottom, 0 , 1 );
780
780
context.canvas
781
781
..saveContext ()
782
782
..setTransform (mat);
@@ -799,7 +799,7 @@ class Opacity extends SingleChildWidget {
799
799
800
800
if (child != null ) {
801
801
final mat = Matrix4 .identity ();
802
- mat.translate (box! .left, box! .bottom);
802
+ mat.translateByDouble (box! .left, box! .bottom, 0 , 1 );
803
803
context.canvas
804
804
..saveContext ()
805
805
..setTransform (mat)
0 commit comments