Specifically, Viewports, Blitter and Resize handling:
Viewport: https://github.com/OpenTTD/OpenTTD/blob/1.9.3/src/viewport.c...
Window resizing: https://github.com/OpenTTD/OpenTTD/blob/1.9.3/src/video/sdl_...
Zoom: https://github.com/OpenTTD/OpenTTD/blob/1.9.3/src/main_gui.c...
OpenTTD is interesting because it can have multiple "cameras" following objects on the screen. e.g. a viewport can be opened to follow a bus or train, zoomed in, while the main viewport is zoomed out.
Also I'd like to recommend aseprite (https://www.aseprite.org/), which has even cleaner code with zoom / panning / etc. The GUI itself is also pixel art: https://github.com/aseprite/aseprite/blob/v1.2.16.3/src/rend..., https://github.com/aseprite/aseprite/blob/v1.2.16.3/src/app/..., https://github.com/aseprite/aseprite/blob/v1.2.16.3/src/ui/v...