From d0dd92789f4f4086c81ceb10aa3c874779db17b8 Mon Sep 17 00:00:00 2001 From: CMK Date: Wed, 30 Jun 2021 16:14:33 +0800 Subject: [PATCH] fix: attachment preview corner radius may missing issue --- .../TableViewCell/ComposeStatusAttachmentTableViewCell.swift | 3 +-- Mastodon/Scene/Compose/View/AttachmentContainerView.swift | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Mastodon/Scene/Compose/TableViewCell/ComposeStatusAttachmentTableViewCell.swift b/Mastodon/Scene/Compose/TableViewCell/ComposeStatusAttachmentTableViewCell.swift index 8b2ce455d..cb4da5765 100644 --- a/Mastodon/Scene/Compose/TableViewCell/ComposeStatusAttachmentTableViewCell.swift +++ b/Mastodon/Scene/Compose/TableViewCell/ComposeStatusAttachmentTableViewCell.swift @@ -93,9 +93,8 @@ extension ComposeStatusAttachmentTableViewCell { cell.attachmentContainerView.previewImageView.image = placeholder return } + // cannot get correct size. set corner radius on layer cell.attachmentContainerView.previewImageView.image = image - .af.imageAspectScaled(toFill: size) - .af.imageRounded(withCornerRadius: AttachmentContainerView.containerViewCornerRadius) } .store(in: &cell.disposeBag) Publishers.CombineLatest( diff --git a/Mastodon/Scene/Compose/View/AttachmentContainerView.swift b/Mastodon/Scene/Compose/View/AttachmentContainerView.swift index eb5f01f41..71893c474 100644 --- a/Mastodon/Scene/Compose/View/AttachmentContainerView.swift +++ b/Mastodon/Scene/Compose/View/AttachmentContainerView.swift @@ -19,6 +19,8 @@ final class AttachmentContainerView: UIView { let previewImageView: UIImageView = { let imageView = UIImageView() imageView.contentMode = .scaleAspectFill + imageView.layer.cornerRadius = AttachmentContainerView.containerViewCornerRadius + imageView.layer.cornerCurve = .continuous imageView.layer.masksToBounds = true return imageView }()