DEV Community

Discussion on: What was your win this week?

Collapse
 
montyharper profile image
Monty Harper

I have finally squashed a bug that's been bugging me for weeks. The text in my marquee view should scroll smoothly, but no, every second there's a little hiccup. At first I thought the parent view was re-constituting the marquee every second (because it was) and that was causing the lurching, but no, I got the view to persist and it still refused to scroll smoothly. Finally I figured out it's a thread thing; I was blocking the main thread with a lot of calculations every second. So I sent the calculations off to a background thread, but then my background view lagged visually behind the drag gesture that zooms it in and out. So I had to change the way I presented the background view. Instead of calculating a new gradient every time the background moves, I made one big gradient and did other (more difficult to conceptualize, but easier to implement) calculations required to show only the right part at the right size in the right location at any given moment. Now my background is light and responsive and the Marquee text scrolls without a hitch - except when there are a lot of events on the screen. So that's what I'm looking into next, but at least I feel like I'm understanding where the problem lies and I keep finding ways to improve it.

That was way more than anyone wanted to know, I'm sure, so to summarize...
I mostly fixed a persistent glitch.

Collapse
 
skyloft7 profile image
Mohammed

This is the subtle bug of nightmares for me. Good job!