Fixed wrong image resize due to the use of backingScaleFactor instead… #3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
… of using the real image size in pixels
Hi!
If had an issue when trying to downscale images.
For example, an @3x image of 180x180 px gives me:
@2x => 90x90px
@1x => 45x45px
The expected results are
@2x => 120x120px
@1x => 60x60px
The issue is due to the use of NSScreen backingScaleFactor to calculate the real size of the image. I have a screen with a backingScaleFactor of 1.
I corrected the code so that we don't calculate the real image size based on the screen scale factor but by using the real image data.