@native-html/iframe-plugin
Version:
🌐 A WebView-based plugin to render iframes in react-native-render-html
26 lines (24 loc) • 714 B
JavaScript
export default function extractPrintDimensions({
attrWidth,
attrHeight,
styleWidth,
styleHeight,
contentWidth
}) {
let printWidth, printHeight;
let ratio;
if (typeof attrWidth === 'number' && typeof attrHeight === 'number') {
ratio = attrWidth / attrHeight;
} else if (typeof styleWidth === 'number' && typeof styleHeight === 'number') {
ratio = styleWidth / styleHeight;
} else {
ratio = 16 / 9;
}
printWidth = Math.min(contentWidth, typeof attrWidth === 'number' ? attrWidth : typeof styleWidth === 'number' ? styleWidth : contentWidth);
printHeight = printWidth / ratio;
return {
printWidth,
printHeight
};
}
//# sourceMappingURL=extractPrintDimensions.js.map