alexiscreuzot / SwiftyGif

High performance GIF engine
MIT License
1.99k stars 210 forks source link

Fix ProMotion display speed #203

Closed laurentboileau closed 4 months ago

laurentboileau commented 4 months ago

Fixes an issue where gifs would play at half speed on ProMotion displays.

displayRefreshDelayTime[0] currently evaluates to 1.0 on ProMotion displays. This fix now evaluates it to 2.0. It remains set to 1.0 on non-ProMotion display devices.

To achieve this, displayRefreshDelayTime values now take into account a frameRateRatio which is the display's maximumFramesPerSecond / 60.

Results

On ProMotion Device (iPhone 13 Pro)

Before After
Before After

On Non-ProMotion Device (iPhone 15 Simulator)

Before After
Before After