Horizontal offset with generic SSD1306 OLED display
Always start with the Data sheet for the device and read
https://cdn-shop.adafruit.com/datasheets/SSD1306.pdf

See 8.3 Oscillator Circuit and Display Time Generator 

The screen your showing looks to be the wrong resolution or the clock frequency has been set incorrectly.
I would say it is in the initialisation that you have a problem, maybe the wrong number entered or you have failed to initialise something as simple as not initialising the divide ratio for the clock.
I would recheck you code and make sure everything was initialised correctly.