This works when the window is large, but it seems that when
the resolution or window size is decreased, even though the
centerCoord calcultation remains correct, the x position of the
content becomes less accurate. For example, the centerCoord value
will be 100, and I will measure on the screen the actual x-value of
the content and it is like 40 or 50.