MailPoet\EmailEditor\Engine\Renderer\ContentRenderer\Layout

Flex_Layout_Renderer::get_width_without_gap()privateWC 1.0

How much of width we will strip to keep some space for the gap This is computed based on CSS rule used in the editor: For block with width set to X percent width: calc(X% - (var(--wp--style--block-gap) * (100 - X)/100)));

Method of the class: Flex_Layout_Renderer{}

No Hooks.

Return

Int.

Usage

// private - for code of main (parent) class only
$result = $this->get_width_without_gap( $block_width, $flex_gap, $block_width_percent ): int;
$block_width(float) (required)
Block width in pixels.
$flex_gap(float) (required)
Flex gap in pixels.
$block_width_percent(float) (required)
Block width in percent.

Flex_Layout_Renderer::get_width_without_gap() code WC 9.8.2

private function get_width_without_gap( float $block_width, float $flex_gap, float $block_width_percent ): int {
	$width_gap_reduction = $flex_gap * ( ( 100 - $block_width_percent ) / 100 );
	return intval( floor( $block_width - $width_gap_reduction ) );
}