Zooming in design mode then changing images does not properly re-adjust scale

Summary

When viewing designs in an Issue, if you zoom in on one of the design images and then navigate to the next/previous image, if that next image has a different aspect ratio, it will initially display distorted.

Steps to reproduce

  • Open an issue with multiple design assets of different size
  • Zoom in on one image
  • Navigate to another image of a different size/aspect ratio

Example Project

#234082 (closed)

What is the current bug behavior?

The next image displays distorted and must be refreshed before it shows correctly.

What is the expected correct behavior?

Images do not display distorted when moving between those of different sizes/aspect ratios while zoomed in.

Relevant logs and/or screenshots

Screen_Recording_2020-09-10_at_10.30.03_AM

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of:
`sudo gitlab-rake gitlab:env:info`)

(For installations from source run and paste the output of:
`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:check SANITIZE=true)

(For installations from source run and paste the output of: sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)

(we will only investigate if the tests are passing)

Possible fixes