UNPKG

@native-html/iframe-plugin

Version:

🌐 A WebView-based plugin to render iframes in react-native-render-html

33 lines (29 loc) 822 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = extractPrintDimensions; 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