The VSE timeline strip thumbnail code seems to have at least two issues:
Sometimes the thumbnail would go 1px outside of the right side of the strip
itself. This seems to be caused by floating point inaccuracy where current
thumbnail position is tracked in "fractional timeline frames" instead of some
integers like pixels. The last, often clipped, thumbnail would thus spill over
outside of the strip. Fixed this by making sure the last pixel column of the
strip is not included into thumbnail drawing (pointless to draw there since it
is always covered by strip border).
Another problem was that the first thumbnail of the strip was often incorrectly
clipped and the last pixel from it was removed, and so it was leaving a pixel
gap between first and other thumbnails. This was under "Set the clipping bound
to show the left handle moving" comment, where due to inclusive range check it
was always causing the "clipped" part to be set to true for the first thumb.
Also while trying to untangle all of this, moved variables closer to their
usage. Some of them were only used inside the thumb loop but were declared in
whole function (probably coming from when it was C code).
Pull Request: https://projects.blender.org/blender/blender/pulls/123119