@@ -451,6 +451,7 @@ void main() {
451451 y: 12 ,
452452 fontWeight: 0 ,
453453 fontSize: 16 ,
454+ transform: null ,
454455 );
455456 codec.writeDrawText (buffer, textId, paintId);
456457 codec.decode (buffer.done (), listener);
@@ -474,6 +475,53 @@ void main() {
474475 16 ,
475476 'Roboto' ,
476477 0 ,
478+ null ,
479+ textId,
480+ ),
481+ OnDrawText (textId, paintId),
482+ ]);
483+ });
484+
485+ test ('Encodes text with transform' , () {
486+ final buffer = VectorGraphicsBuffer ();
487+ final TestListener listener = TestListener ();
488+
489+ final Float64List transform = Float64List (16 );
490+ transform[15 ] = 10 ;
491+ final int paintId = codec.writeFill (buffer, 0xFFAABBAA , 0 );
492+ final int textId = codec.writeTextConfig (
493+ buffer: buffer,
494+ text: 'Hello' ,
495+ fontFamily: 'Roboto' ,
496+ x: 10 ,
497+ y: 12 ,
498+ fontWeight: 0 ,
499+ fontSize: 16 ,
500+ transform: transform,
501+ );
502+ codec.writeDrawText (buffer, textId, paintId);
503+ codec.decode (buffer.done (), listener);
504+
505+ expect (listener.commands, [
506+ OnPaintObject (
507+ color: 0xFFAABBAA ,
508+ strokeCap: null ,
509+ strokeJoin: null ,
510+ blendMode: 0 ,
511+ strokeMiterLimit: null ,
512+ strokeWidth: null ,
513+ paintStyle: 0 ,
514+ id: paintId,
515+ shaderId: null ,
516+ ),
517+ OnTextConfig (
518+ 'Hello' ,
519+ 10 ,
520+ 12 ,
521+ 16 ,
522+ 'Roboto' ,
523+ 0 ,
524+ transform,
477525 textId,
478526 ),
479527 OnDrawText (textId, paintId),
@@ -493,6 +541,7 @@ void main() {
493541 y: 12 ,
494542 fontWeight: 0 ,
495543 fontSize: 16 ,
544+ transform: null ,
496545 );
497546 codec.writeDrawText (buffer, textId, paintId);
498547 codec.decode (buffer.done (), listener);
@@ -516,6 +565,7 @@ void main() {
516565 16 ,
517566 null ,
518567 0 ,
568+ null ,
519569 textId,
520570 ),
521571 OnDrawText (textId, paintId),
@@ -535,6 +585,7 @@ void main() {
535585 y: 12 ,
536586 fontWeight: 0 ,
537587 fontSize: 16 ,
588+ transform: null ,
538589 );
539590 codec.writeDrawText (buffer, textId, paintId);
540591 codec.decode (buffer.done (), listener);
@@ -558,6 +609,7 @@ void main() {
558609 16 ,
559610 null ,
560611 0 ,
612+ null ,
561613 textId,
562614 ),
563615 OnDrawText (textId, paintId),
@@ -721,6 +773,7 @@ class TestListener extends VectorGraphicsCodecListener {
721773 double dy,
722774 int fontWeight,
723775 double fontSize,
776+ Float64List ? transform,
724777 int id,
725778 ) {
726779 commands.add (OnTextConfig (
@@ -730,6 +783,7 @@ class TestListener extends VectorGraphicsCodecListener {
730783 fontSize,
731784 fontFamily,
732785 fontWeight,
786+ transform,
733787 id,
734788 ));
735789 }
@@ -1102,6 +1156,7 @@ class OnTextConfig {
11021156 this .fontSize,
11031157 this .fontFamily,
11041158 this .fontWeight,
1159+ this .transform,
11051160 this .id,
11061161 );
11071162
@@ -1112,10 +1167,11 @@ class OnTextConfig {
11121167 final String ? fontFamily;
11131168 final int fontWeight;
11141169 final int id;
1170+ final Float64List ? transform;
11151171
11161172 @override
1117- int get hashCode =>
1118- Object .hash (text, x, y, fontSize, fontFamily, fontWeight , id);
1173+ int get hashCode => Object . hash (text, x, y, fontSize, fontFamily, fontWeight,
1174+ Object .hashAll (transform ?? Float64List ( 0 )) , id);
11191175
11201176 @override
11211177 bool operator == (Object other) =>
@@ -1126,11 +1182,12 @@ class OnTextConfig {
11261182 other.fontSize == fontSize &&
11271183 other.fontFamily == fontFamily &&
11281184 other.fontWeight == fontWeight &&
1185+ _listEquals (other.transform, transform) &&
11291186 other.id == id;
11301187
11311188 @override
11321189 String toString () =>
1133- 'OnTextConfig($text , $x , $y , $fontSize , $fontFamily , $fontWeight , $id )' ;
1190+ 'OnTextConfig($text , $x , $y , $fontSize , $fontFamily , $fontWeight , $transform , $ id )' ;
11341191}
11351192
11361193class OnDrawText {
0 commit comments