Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

large images are not scaled to stay inside diff panel #2480

Closed
shiftkey opened this issue Aug 17, 2017 · 19 comments · Fixed by #10904
Closed

large images are not scaled to stay inside diff panel #2480

shiftkey opened this issue Aug 17, 2017 · 19 comments · Fixed by #10904
Labels
bug Confirmed bugs or reports that are very likely to be bugs help wanted Issues marked as ideal for external contributors priority-3 Bugs that affect small number of users and/or relatively cosmetic in nature windows Issues specific Desktop usage on Windows

Comments

@shiftkey
Copy link
Member

Description

With the new image diff improvements in #2383 there's a scenario where a large image is drawn outside the diff panel. We shouldn't do this.

Version

GitHub Desktop version: current master e.g. 82b1d23
OS version: Windows 10

Steps to Reproduce

  1. Clone https://github.com/shiftkey/image-examples
  2. Switch to History tab
  3. Select this commit shiftkey/image-examples@10c1cf4
  4. Ensure you have 2-up selected (but the others show this problem too)

Expected behavior:

  • Image does not display outside diff view.
  • Can toggle between different modes.

Actual behavior:

  • Image drawn over top menu.
  • Unable to change diff mode.

Reproduces how often: 100%

@shiftkey shiftkey added help wanted Issues marked as ideal for external contributors bug Confirmed bugs or reports that are very likely to be bugs labels Aug 17, 2017
@joshaber
Copy link
Contributor

😱

I think we should fix this for 1.0.

@joshaber joshaber added this to the 1.0: The Last Milestone milestone Aug 17, 2017
@joshaber joshaber self-assigned this Aug 17, 2017
@joshaber
Copy link
Contributor

joshaber commented Aug 17, 2017

Huh, interestingly I can't reproduce this on Mac :hurtrealbad:

@joshaber
Copy link
Contributor

Hrm, I can't reproduce this in my Windows 8 VM either. Gonna try getting a Windows 10 VM running.

@joshaber
Copy link
Contributor

I'm having VMWare troubles with Windows 10, so I'm gonna unassign myself until I'm able to reproduce it.

@joshaber joshaber removed their assignment Aug 17, 2017
@shiftkey shiftkey assigned shiftkey and unassigned shiftkey Aug 18, 2017
@iAmWillShepherd iAmWillShepherd self-assigned this Aug 28, 2017
@iAmWillShepherd
Copy link
Contributor

I'm unable to reproduce this issue. Are you still having it?

@tierninho
Copy link
Contributor

tierninho commented Aug 28, 2017

Was just looking at this too, can't reproduce either. Tested in Windows 10.

@joshaber
Copy link
Contributor

Gonna 👢 this until we can reproduce it.

@shiftkey
Copy link
Member Author

Still reproducible on 0.8.1-beta2 on a Windows 10 VM:

👍 to defer until someone else can reproduce this.

@PragmaticEd
Copy link

I uploaded git project here, that reproduces the problem. @tierninho please open the issue again, till fixed.

@niik
Copy link
Member

niik commented Oct 18, 2017

@PragmaticEd thank you so much for taking the time to create a reproduction repository.

Unfortunately I wasn't able to reproduce this using the repo provided on macOS, haven't tested it on Windows 10 yet.

screen shot 2017-10-18 at 11 40 48

@PragmaticEd Are you using multiple monitors or different DPI scaling settings by any chance?

@tierninho
Copy link
Contributor

@PragmaticEd thanks for checking in and adding your project.

As this issue is still open, we will be tracking it here. Your #3075 issue is noted.

@PragmaticEd
Copy link

@tierninho Yes, that might be it. I have 4k screen, set to 4k resolution and 200% scaling. Just tested. By setting the scaling to 100%, this problem goes away. So the problem is with scaling. I tried disabling the scaling for the app, like so: http://take.ms/jbXkW That, usually, fixes the problem for most other apps, but not this time..

@niik
Copy link
Member

niik commented Oct 18, 2017

Yes, that might be it. I have 4k screen, set to 4k resolution and 200% scaling. Just tested. By setting the scaling to 100%, this problem goes away.

Excellent. I think I've got a good sense of what's going on then. The image diff uses a ResizeObserver which returns native pixels and then applies them as logical pixels. This has been a problem for us in the past. This should be a fairly straightforward fix of using offsetWidth and offsetHeight instead like we do in list.tsx. See #1200 and #1201 (but note that getClientBoundingRect isn't the answer due to zooming, see 03a86e5)

@j-f1
Copy link
Contributor

j-f1 commented Dec 21, 2017

I have a retina screen and I’ve encountered this with (tall?) images.

@shiftkey
Copy link
Member Author

#5215 was another report that seems related to this issue

I added an image to my repository, it's size was 2600x3100 pixels. I previewed it before commiting changes. The 2-up view were selected. The image hided some of the navbar's components, like a layer whichs z-index is incorrect.

@ChiriVulpes
Copy link

I use 125% zoom and I have this issue very frequently in an image-heavy repository. It can cover the branch/fetch buttons in the changes view, and always covers the diff view options in the history view. I have to resize down to 100% to work with this repository.

@tierninho tierninho added the priority-3 Bugs that affect small number of users and/or relatively cosmetic in nature label Oct 11, 2018
@fdmarcin
Copy link

Hi! This affects me too on Windows 10, GH Desktop 1.4.3.
The image dimensions are 1532 x 794, and my screen resolution is 1920 x 1080 with 150% scaling.
The menu bar in the screenshot is part of the image in the diff btw.
gh-desktop-image

@ghost
Copy link

ghost commented Dec 11, 2018

I am still able to reproduce this in 1.5.0

@shiftkey shiftkey added the windows Issues specific Desktop usage on Windows label Jan 6, 2019
@shiftkey
Copy link
Member Author

shiftkey commented Jan 6, 2019

I've been able to reproduce this on Windows 10 and I think it's some combination of scaling and screen real-estate.

This is the commit I'm working with (thanks @AndyThePie for the setup): 12beesinatrenchcoat/pizzaRPG-repo@0233f1c

At 100% scaling on a 1440x900px display, the image diff is scaled down to fit into the space:

At 200% scaling on a 2560x1440px display, the image is no longer scaled down:

Probably requires some refreshing of what the image diff controls are rendering and whether they care about the available space...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed bugs or reports that are very likely to be bugs help wanted Issues marked as ideal for external contributors priority-3 Bugs that affect small number of users and/or relatively cosmetic in nature windows Issues specific Desktop usage on Windows
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants