diff --git a/Sources/AquaKit/Controls and Views/AquaSegmentedCell.swift b/Sources/AquaKit/Controls and Views/AquaSegmentedCell.swift index f698fd5..8da33bc 100644 --- a/Sources/AquaKit/Controls and Views/AquaSegmentedCell.swift +++ b/Sources/AquaKit/Controls and Views/AquaSegmentedCell.swift @@ -2,6 +2,7 @@ // // SPDX-License-Identifier: MIT +import AVFoundation import AppKit open class AquaSegmentedCell: NSSegmentedCell { @@ -146,7 +147,11 @@ open class AquaSegmentedCell: NSSegmentedCell { if let image = image(forSegment: segment) { let inset = frame.width * 0.25 let imageRect = frame.insetBy(dx: inset, dy: inset) - image.draw(in: imageRect) + let fittedRect = AVMakeRect( + aspectRatio: image.size, + insideRect: imageRect + ) + image.draw(in: fittedRect) } }