Fix flickering when resizing

@lolilolicon can you see if this fixes your flickering issue?