Only the newly "exposed" areas of the window are part of the update region when the paint event is sent, so the rest of the window is clipped out of what is drawn to the screen. In cases like this when changing size causes what is in the already visible portions of the window to also be changed then you need to force the whole window to be refreshed. There is a window style that can be used to do this, but usually I just call Refresh from an EVT_SIZE handler so it is more explicit what is happening.
I've attached a modified version of your sample that does this in a simple way that works fine for OSX. It will probably cause flicker on Windows though so it would need to be a bit more complex to work well everywhere.
When I resize the window, making it bigger, the program does not recalculate a new center and redraw with a new center. I'm on a macbook pro.
What am I missing?
Only the newly "exposed" areas of the window are part of the update region when the paint event is sent, so the rest of the window is clipped out of what is drawn to the screen. In cases like this when changing size causes what is in the already visible portions of the window to also be changed then you need to force the whole window to be refreshed. There is a window style that can be used to do this, but usually I just call Refresh from an EVT_SIZE handler so it is more explicit what is happening.
I've attached a modified version of your sample that does this in a simple way that works fine for OSX. It will probably cause flicker on Windows though so it would need to be a bit more complex to work well everywhere.