Skip to content

Commit

Permalink
zoomToFit should allow image to scale up to full parent size
Browse files Browse the repository at this point in the history
If the user overrides `object-fit` from `scale-down` to `contain` like:
```css
.image-view .zoom-to-fit.image-container img {
  object-fit: contain;
}
```

then before this change an svg image (atom#165) wouldn't scale up beyond its
default size. After this change an svg image does scale up to fill the
whole window.
  • Loading branch information
jdanbrown committed Nov 27, 2017
1 parent 430cd5e commit 88070ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/image-editor-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ export default class ImageEditorView {
this.mode = 'zoom-to-fit'
this.refs.imageContainer.classList.add('zoom-to-fit')
this.refs.zoomToFitButton.classList.add('selected')
this.refs.image.style.width = ''
this.refs.image.style.height = ''
this.refs.image.style.width = '100%'
this.refs.image.style.height = 'auto'
this.refs.resetZoomButton.textContent = 'Auto'
this.percentageStep = 4
}
Expand Down

0 comments on commit 88070ec

Please sign in to comment.