Skip to content

Commit 259c46a

Browse files
committed
zoomToFit should allow image to scale up to full parent size
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.
1 parent 4b5d9dc commit 259c46a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/image-editor-view.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,8 @@ export default class ImageEditorView {
165165
this.mode = 'zoom-to-fit'
166166
this.refs.imageContainer.classList.add('zoom-to-fit')
167167
this.refs.zoomToFitButton.classList.add('selected')
168-
this.refs.image.style.width = ''
169-
this.refs.image.style.height = ''
168+
this.refs.image.style.width = '100%'
169+
this.refs.image.style.height = 'auto'
170170
this.refs.resetZoomButton.textContent = 'Auto'
171171
this.percentageStep = 4
172172
}

0 commit comments

Comments
 (0)