Skip to content

Commit d92d27e

Browse files
committed
Thanks, iOS: Set width and height on RuneSVG
1 parent 5839722 commit d92d27e

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

src/components/RuneSVG/index.css

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
svg.runic-svg {
2-
max-width: 100%;
3-
max-height: 100%;
2+
width: 100%;
3+
height: 100%;
44
}
55

66
/* Add styles to the interactive layer */

src/components/RuneSVG/index.tsx

+5
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ import { sanitizeBitmask } from "src/rune";
2222
export interface Props extends Partial<StateInProps> {
2323
interactive: boolean;
2424
phoneticText: string;
25+
26+
svgProps?: preact.JSX.SVGAttributes<any>;
2527
}
2628

2729
interface StateInProps {
@@ -328,9 +330,12 @@ export class RuneSVG extends Component<Props, State> {
328330
class="runic-svg"
329331
preserveAspectRatio="xMidYMid meet"
330332
viewBox={viewBox}
333+
width={viewBoxWidth}
334+
height={viewBoxHeight}
331335
version="1.1"
332336
xmlns="http://www.w3.org/2000/svg"
333337
xmlnsXlink="http://www.w3.org/1999/xlink"
338+
{...props.svgProps}
334339
>
335340
{/* Simple optimization, may be removed if troublesome */}
336341
{state.runeGuideColor !== "transparent" && (

src/components/SocialMediaCard/index.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ export class SocialMediaCard extends Component<SocialMediaCardProps, State> {
4242
interactive={false}
4343
runeColor=""
4444
runeGuideColor=""
45+
svgProps={{
46+
preserveAspectRatio: "xMinYMin meet"
47+
}}
4548
/>
4649
</div>
4750
<div className="sm-card__interactions">

0 commit comments

Comments
 (0)