@@ -636,44 +636,44 @@ protected function getTranslator()
636
636
*
637
637
* @return Image
638
638
*/
639
- protected function makeAvatar ($ image )
640
- {
641
- $ width = $ this ->getWidth ();
642
- $ height = $ this ->getHeight ();
643
- $ bgColor = $ this ->getBackgroundColor ();
644
- $ name = $ this ->getInitials ();
645
- $ fontFile = $ this ->findFontFile ();
646
- $ color = $ this ->getColor ();
647
- $ fontSize = $ this ->getFontSize ();
648
-
649
- if ($ this ->getRounded () && $ this ->getSmooth ()) {
650
- $ width *= 5 ;
651
- $ height *= 5 ;
652
- }
639
+ protected function makeAvatar ($ image )
640
+ {
641
+ $ width = $ this ->getWidth ();
642
+ $ height = $ this ->getHeight ();
643
+ $ bgColor = $ this ->getBackgroundColor ();
644
+ $ name = $ this ->getInitials ();
645
+ $ fontFile = $ this ->findFontFile ();
646
+ $ color = $ this ->getColor ();
647
+ $ fontSize = $ this ->getFontSize ();
653
648
654
- $ avatar = $ image ->canvas ($ width , $ height , !$ this ->getRounded () ? $ bgColor : null );
649
+ if ($ this ->getRounded () && $ this ->getSmooth ()) {
650
+ $ width *= 5 ;
651
+ $ height *= 5 ;
652
+ }
655
653
656
- if ($ this ->getRounded ()) {
657
- $ avatar = $ avatar ->circle ($ width - 2 , $ width / 2 , $ height / 2 , function ($ draw ) use ($ bgColor ) {
658
- return $ draw ->background ($ bgColor );
659
- });
660
- }
654
+ $ avatar = $ image ->canvas ($ width , $ height , !$ this ->getRounded () ? $ bgColor : null );
661
655
662
- if ($ this ->getRounded () && $ this ->getSmooth ()) {
663
- $ width /= 5 ;
664
- $ height /= 5 ;
665
- $ avatar ->resize ($ width , $ height );
666
- }
667
-
668
- return $ avatar ->text ($ name , $ width / 2 , $ height / 2 , function (AbstractFont $ font ) use ($ width , $ color , $ fontFile , $ fontSize ) {
669
- $ font ->file ($ fontFile );
670
- $ font ->size ($ width * $ fontSize );
671
- $ font ->color ($ color );
672
- $ font ->align ('center ' );
673
- $ font ->valign ('center ' );
656
+ if ($ this ->getRounded ()) {
657
+ $ avatar = $ avatar ->circle ($ width - 2 , $ width / 2 , $ height / 2 , function ($ draw ) use ($ bgColor ) {
658
+ return $ draw ->background ($ bgColor );
674
659
});
675
660
}
676
661
662
+ if ($ this ->getRounded () && $ this ->getSmooth ()) {
663
+ $ width /= 5 ;
664
+ $ height /= 5 ;
665
+ $ avatar ->resize ($ width , $ height );
666
+ }
667
+
668
+ return $ avatar ->text ($ name , $ width / 2 , $ height / 2 , function ($ draw ) use ($ width , $ color , $ fontFile , $ fontSize ) {
669
+ $ draw ->file ($ fontFile );
670
+ $ draw ->size ($ width * $ fontSize );
671
+ $ draw ->color ($ color );
672
+ $ draw ->align ('center ' );
673
+ $ draw ->valign ('center ' );
674
+ });
675
+ }
676
+
677
677
/**
678
678
* @return SVG
679
679
*/
0 commit comments