INNER CODE UNIT · JavaScript

gutterBase

brh55/react-native-masonry · components/Column.js:67

		const gutterBase = width / 100;
		const gutterSize = gutterBase * this.props.spacing;

		// Column gutters are shared between right and left image
		const columnWidth = (width / nColumns) - (gutterSize / 2);

		if (this.state.columnWidth !== columnWidth) {
			this.setState({
				columnWidth
			});
		}

		const divider = imgDimensions.width / columnWidth;

		const newWidth = imgDimensions.width / divider;
		const newHeight = imgDimensions.height / divider;

		return { width: newWidth, height: newHeight, gutter: gutterSize };

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…