Fix canvas rescaling proportions with css

This commit is contained in:
Guntis Smaukstelis
2024-02-08 15:42:36 +02:00
parent b631c039c0
commit a70fe56a82
+7 -1
View File
@@ -68,6 +68,12 @@ export const MapView: Component<{ type: MapResolution, data: () => ResultKeyVal[
);
});
const getStyleSize = () => {
return props.width === 1920
? { "width": "1000px", "height": "562px" }
: { "width": "1000px", "height": "374px" };
}
return (
<>
{ props.showWind && <WindInputs signals={windSignals} /> }
@@ -75,7 +81,7 @@ export const MapView: Component<{ type: MapResolution, data: () => ResultKeyVal[
ref={setCanvas}
width={props.width+"px"}
height={props.height+"px"}
style={{"max-width": "1000px"}}
style={getStyleSize()}
/>
</>
);