mirror of
https://github.com/ninxsoft/Mist.git
synced 2025-05-18 17:25:21 -04:00
Update TextRibbon.swift (#65)
* Update TextRibbon.swift * Add back rotation effect * Added comment for future reference * Fixed typo * Fix text selection on TextRibbon
This commit is contained in:
parent
f215031df1
commit
e3a6d930d5
2 changed files with 4 additions and 2 deletions
|
@ -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))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue