Example #1
0
 function __construct($xls, $marker_block_width, $marker_block_height, $marker_offset_x, $marker_offset_y, $marker_size)
 {
     parent::__construct($xls);
     // args as disp scale(without marker window)
     $this->marker_block_width = $marker_block_width;
     $this->marker_block_height = $marker_block_height;
     $this->marker_offset_x = $marker_offset_x;
     $this->marker_offset_y = $marker_offset_y;
     $this->size_of_marker = $marker_size;
     // calc sheet size
     $this->sheet_width = 0;
     $this->sheet_height = 0;
     $width_marker_window_without_offset = $this->marker_block_width + $this->marker_offset_x;
     if ($this->marker_offset_x < 0) {
         // add offset
         $this->sheet_width += abs($this->marker_offset_x);
         $width_marker_window_without_offset = $this->marker_block_width;
     }
     if ($this->disp->tblwidth > $width_marker_window_without_offset) {
         $this->sheet_width += $this->disp->tblwidth;
     } else {
         $this->sheet_width += $width_marker_window_without_offset;
     }
     $height_marker_window_without_offset = $this->marker_block_height + $this->marker_offset_y;
     if ($this->marker_offset_y < 0) {
         // add offset
         $this->sheet_height += abs($this->marker_offset_y);
         $height_marker_window_without_offset = $this->marker_block_height;
     }
     if ($this->disp->tblheight > $height_marker_window_without_offset) {
         $this->sheet_height += $this->disp->tblheight;
     } else {
         $this->sheet_height += $height_marker_window_without_offset;
     }
     // 縮小/拡大率
     $this->marker_scale = get_scaling($this->sheet_width, $this->sheet_height, 960);
     // 表示サイズ取得
     $this->disp_sheet = new DispSheetMarker($this);
 }