From e3a6d930d5066acf87d88f9a57d2d9bb107f9b1f Mon Sep 17 00:00:00 2001 From: Nindi Gill Date: Sat, 24 Jun 2023 23:15:44 +1000 Subject: [PATCH] Update TextRibbon.swift (#65) * Update TextRibbon.swift * Add back rotation effect * Added comment for future reference * Fixed typo * Fix text selection on TextRibbon --- Mist/Views/Components/TextRibbon.swift | 5 +++-- Mist/Views/List/ListRowDetail.swift | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Mist/Views/Components/TextRibbon.swift b/Mist/Views/Components/TextRibbon.swift index 0851f31..d8a31a1 100644 --- a/Mist/Views/Components/TextRibbon.swift +++ b/Mist/Views/Components/TextRibbon.swift @@ -10,15 +10,16 @@ import SwiftUI struct TextRibbon: View { var title: String var length: CGFloat - private let degrees: CGFloat = -45 + private let degrees: CGFloat = -45.001 + // app crashes when value is exactly -45 ¯\_(ツ)_/¯ var body: some View { Text(title) .foregroundColor(.white) .frame(width: length) .background(Color.accentColor) - .rotationEffect(.degrees(degrees)) .mask(Circle().frame(width: length, height: length)) + .rotationEffect(.degrees(degrees)) } } diff --git a/Mist/Views/List/ListRowDetail.swift b/Mist/Views/List/ListRowDetail.swift index 5143e31..b0c7f22 100644 --- a/Mist/Views/List/ListRowDetail.swift +++ b/Mist/Views/List/ListRowDetail.swift @@ -24,6 +24,7 @@ struct ListRowDetail: View { ScaledImage(name: imageName, length: length) if beta { TextRibbon(title: "BETA", length: length * 0.9) + .textSelection(.disabled) } } HStack(spacing: spacing) {