You are here

public static function PHPExcel_Shared_Excel5::getDistanceY in Loft Data Grids 6.2

Same name and namespace in other branches
  1. 7.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/Excel5.php \PHPExcel_Shared_Excel5::getDistanceY()

* Get the vertical distance in pixels between two anchors * The distanceY is found as sum of all the spanning rows minus two offsets * *

Parameters

PHPExcel_Worksheet $sheet: * @param integer $startRow (1-based) * @param integer $startOffsetY Offset within start cell measured in 1/256 of the cell height * @param integer $endRow (1-based) * @param integer $endOffsetY Offset within end cell measured in 1/256 of the cell height * @return integer Vertical distance measured in pixels

1 call to PHPExcel_Shared_Excel5::getDistanceY()
PHPExcel_Reader_Excel5::load in vendor/phpoffice/phpexcel/Classes/PHPExcel/Reader/Excel5.php
* Loads PHPExcel from file * *

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/Excel5.php, line 175

Class

PHPExcel_Shared_Excel5
PHPExcel_Shared_Excel5

Code

public static function getDistanceY(PHPExcel_Worksheet $sheet, $startRow = 1, $startOffsetY = 0, $endRow = 1, $endOffsetY = 0) {
  $distanceY = 0;

  // add the widths of the spanning rows
  for ($row = $startRow; $row <= $endRow; ++$row) {
    $distanceY += self::sizeRow($sheet, $row);
  }

  // correct for offsetX in startcell
  $distanceY -= (int) floor(self::sizeRow($sheet, $startRow) * $startOffsetY / 256);

  // correct for offsetX in endcell
  $distanceY -= (int) floor(self::sizeRow($sheet, $endRow) * (1 - $endOffsetY / 256));
  return $distanceY;
}