@@ -1053,21 +1053,32 @@ def resizeImages(self, manually=False):
10531053 # calculate factor of resizing
10541054 xf = float (vw )/ iw
10551055 yf = float (vh )/ ih
1056- if (self .app .opt .preserve_aspect_ratio
1057- and not self .app .opt .spread_stacks ):
1058- xf = yf = min (xf , yf )
1056+ if self .app .opt .preserve_aspect_ratio :
1057+ if self .app .opt .spread_stacks :
1058+ # layout uses full xf, yf; images use uniform scale
1059+ xf_img , yf_img = min (xf , yf ), min (xf , yf )
1060+ else :
1061+ xf = yf = min (xf , yf )
1062+ xf_img , yf_img = xf , yf
1063+ else :
1064+ xf_img , yf_img = xf , yf
10591065 else :
10601066 xf , yf = self .app .opt .scale_x , self .app .opt .scale_y
1067+ xf_img , yf_img = xf , yf
1068+
10611069 if (not self .app .opt .center_layout or self .app .opt .spread_stacks or
10621070 (self .app .opt .auto_scale and not
10631071 self .app .opt .preserve_aspect_ratio )):
10641072 self .center_offset = 0 , 0
10651073 else :
10661074 self .center_offset = self .app .images .getCenterOffset (
10671075 vw , vh , iw , ih , xf , yf , self .app .opt .auto_scale )
1068- if (not self .app .opt .spread_stacks or manually ):
1076+
1077+ if (not self .app .opt .spread_stacks or self .app .opt .auto_scale
1078+ or manually ):
10691079 # images
1070- self .app .images .resize (xf , yf , resample = self .app .opt .resampling )
1080+ self .app .images .resize (xf_img , yf_img ,
1081+ resample = self .app .opt .resampling )
10711082 # cards
10721083 for card in self .cards :
10731084 card .update (card .id , card .deck , card .suit , card .rank , self )
0 commit comments