                 } else {
                     fillDiamond(context: context, rect: rect)
                 }
-            default:
+            case .square:
                 context.fill(rect)
         }
     }

                ) {
                result = tryModeImage
            }
        default:
            break
        }


            let scale = max(imageSize.width / size.width, imageSize.height / size.height)
            finalSize = CGSize(width: imageSize.width / scale, height: imageSize.height / scale)
            finalOrigin = CGPoint(x: (size.width - finalSize.width) / 2.0, y: (size.height - finalSize.height) / 2.0)
        case .scaleToFill:
            break
        }
        context.draw(image, in: CGRect(origin: finalOrigin, size: finalSize))
