Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/ui/widgets/Image/image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ export const ImageComponent = (
...commonCss(props as any),
overflow,
textAlign: "left",
width: imageWidth,
height: imageHeight
width: "100%",
height: "100%"
};

// Should we be refreshing image instead of using cache
Expand All @@ -81,7 +81,8 @@ export const ImageComponent = (
transform: `rotate(${rotation}deg) scaleX(${
flipHorizontal ? -1 : 1
}) scaleY(${flipVertical ? -1 : 1})`,
objectFit: props.stretchToFit ? "fill" : "none"
objectFit: props.stretchToFit ? "fill" : "none",
objectPosition: "top left"
}}
/>
</div>
Expand Down
12 changes: 6 additions & 6 deletions src/ui/widgets/Symbol/__snapshots__/symbol.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ exports[`<Symbol /> from .bob file > matches snapshot (using fallback symbol) 1`
>
<img
src="https://cs-web-symbol.diamond.ac.uk/catalogue/default.svg"
style="width: 100%; height: 100%; display: block; transform: rotate(0deg) scaleX(1) scaleY(1); object-fit: fill;"
style="width: 100%; height: 100%; display: block; transform: rotate(0deg) scaleX(1) scaleY(1); object-fit: fill; object-position: top left;"
/>
</div>
</DocumentFragment>
Expand All @@ -20,7 +20,7 @@ exports[`<Symbol /> from .bob file > matches snapshot (with index) 1`] = `
>
<img
src="img 3.svg"
style="width: 100%; height: 100%; display: block; transform: rotate(0deg) scaleX(1) scaleY(1); object-fit: fill;"
style="width: 100%; height: 100%; display: block; transform: rotate(0deg) scaleX(1) scaleY(1); object-fit: fill; object-position: top left;"
/>
</div>
</DocumentFragment>
Expand All @@ -33,7 +33,7 @@ exports[`<Symbol /> from .bob file > matches snapshot (with rotation) 1`] = `
>
<img
src="img 1.gif"
style="width: 100%; height: 100%; display: block; transform: rotate(45deg) scaleX(1) scaleY(1); object-fit: fill;"
style="width: 100%; height: 100%; display: block; transform: rotate(45deg) scaleX(1) scaleY(1); object-fit: fill; object-position: top left;"
/>
</div>
</DocumentFragment>
Expand All @@ -46,7 +46,7 @@ exports[`<Symbol /> from .bob file > matches snapshot (without index) 1`] = `
>
<img
src="img 1.gif"
style="width: 100%; height: 100%; display: block; transform: rotate(0deg) scaleX(1) scaleY(1); object-fit: fill;"
style="width: 100%; height: 100%; display: block; transform: rotate(0deg) scaleX(1) scaleY(1); object-fit: fill; object-position: top left;"
/>
</div>
</DocumentFragment>
Expand All @@ -59,7 +59,7 @@ exports[`<Symbol /> from .opi file > matches snapshot (with rotation) 1`] = `
>
<img
src="img 1.gif"
style="width: 100%; height: 100%; display: block; transform: rotate(45deg) scaleX(1) scaleY(1); object-fit: fill;"
style="width: 100%; height: 100%; display: block; transform: rotate(45deg) scaleX(1) scaleY(1); object-fit: fill; object-position: top left;"
/>
</div>
</DocumentFragment>
Expand All @@ -72,7 +72,7 @@ exports[`<Symbol /> from .opi file > matches snapshot 1`] = `
>
<img
src="img 1.gif"
style="width: 100%; height: 100%; display: block; transform: rotate(0deg) scaleX(1) scaleY(1); object-fit: fill;"
style="width: 100%; height: 100%; display: block; transform: rotate(0deg) scaleX(1) scaleY(1); object-fit: fill; object-position: top left;"
/>
</div>
<div
Expand Down