macfeh
macfeh copied to clipboard
imageView not resized to image size
Sup, when an image is loaded the imageView isn't resizing to the window size, it leaves a massive grey border
I'm terrible with Swift, but I had a look and tried putting
self.imageView.zoomImageToActualSize(self);
From the zoomToActualSize() function at the end of the display() function and that seems to work
I don't know it that's intentional or not, but it doesn't seem like it from the screens
No that's not what should be happening at all. Does putting self.zoomToFit(); at the end of display instead of self.imageView.zoomImageToActualSize(self); fix anything?
self.zoomToFit(); doesn't change anything, but self.zoomImageToActualSize(); works. I don't know why self.zoomToFit(); doesn't work. Very odd. Here is a screenshot with self.zoomToFit(); the function seems to do nothing http://www.tiikoni.com/tis/view/?id=e2f5c09
Could you upload the image? I want to see if I can recreate this issue
It happens with all images, maybe it's different version of something? Or because of the scaling of the retina displays? I'm on 10.12.2, 2015 15" MacBook Pro, xcode version 8.2.1
Although this maybe a while ago I have the same problem here, although I've seen you already added self.imageView.zoomImageToActualSize(self); at the end of display().
But yet it's still left with the grey scroll borders on the bottom and right sides when viewing 'zoom to fit' for some reason. Super confusing.
I added self.zoomImageToActualSize(); to the end of display()
Like this
// Update the defaults to match the preferences
self.showBackground((NSApp.delegate as! AppDelegate).preferences.viewerDefaultsShowBackground);
self.showShadow((NSApp.delegate as! AppDelegate).preferences.viewerDefaultsEnableShadow);
self.zoomImageToActualSize();
// Set `representedImage`
self.representedImage = image;
That worked for me
i have the same issue only adding the text to the line did nothing, in the log i get this though
Unknown Window class (null) in Interface Builder file, creating generic Window instead
that seems to be a bug with the latest version of xcode
https://stackoverflow.com/questions/47051682/unknown-window-class-null-in-interface-builder-file-creating-generic-window-i
The unknown window class thing is unrelated, I've experienced it in multiple other projects when using Xcode 9.
~~Can anyone else that used the fix posted by @takeiteasy confirm that it's still working for them? Odd that it would work for most but not @oxycantha.~~
Scratch that, working on a proper fix now.
Given that the last update on this project was just under two years ago, I have forked it and created a proper fix myself.
If this repository isn't dead please let me know and I will be happy to make a pull request.
Edit: Scratch that, adding a pull request anyway.