joekndy / MarqueeText

Marquee or "scrolling text" effect in SwiftUI
258 stars 43 forks source link

Text duplication #6

Closed kimfucious closed 2 years ago

kimfucious commented 3 years ago

Hi there,

Thanks for this handy library!

I'm not sure what i'm doing wrong, but it appears that I'm getting duplicate entries (on the horizontal), per the below.

image

If you look close, both the track title and album titles start to show again on the right, if they are not long enough to scroll kick off the scrolling.

I've bascially got the text items in a VStack, inside an HStack to the right of the album artwork.

VStack(alignment: .leading) {
    MarqueeText(
        text: item.track.name,
        font: UIFont.preferredFont(forTextStyle: .headline),
        leftFade: 16,
        rightFade: 16,
        startDelay: 3
    )
    MarqueeText(
        text: item.track.album?.name ?? "",
        font: UIFont.preferredFont(forTextStyle: .caption1),
        leftFade: 16,
        rightFade: 16,
        startDelay: 3
    )
}

Any thoughts?

kimfucious commented 2 years ago

Resolved by PR #7