Changeset View
Changeset View
Standalone View
Standalone View
src/view/phui/PHUIImageMaskView.php
Show All 35 Lines | public function centerViewOnPoint($x, $y, $h, $w) { | ||||
return $this; | return $this; | ||||
} | } | ||||
public function withMask($mask) { | public function withMask($mask) { | ||||
$this->withMask = $mask; | $this->withMask = $mask; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getTagName() { | protected function getTagName() { | ||||
return 'div'; | return 'div'; | ||||
} | } | ||||
public function getTagAttributes() { | protected function getTagAttributes() { | ||||
require_celerity_resource('phui-image-mask-css'); | require_celerity_resource('phui-image-mask-css'); | ||||
$classes = array(); | $classes = array(); | ||||
$classes[] = 'phui-image-mask'; | $classes[] = 'phui-image-mask'; | ||||
$styles = array(); | $styles = array(); | ||||
$styles[] = 'height: '.$this->displayHeight.'px;'; | $styles[] = 'height: '.$this->displayHeight.'px;'; | ||||
$styles[] = 'width: '.$this->displayWidth.'px;'; | $styles[] = 'width: '.$this->displayWidth.'px;'; | ||||
return array( | return array( | ||||
'class' => implode(' ', $classes), | 'class' => implode(' ', $classes), | ||||
'styles' => implode(' ', $styles), | 'styles' => implode(' ', $styles), | ||||
); | ); | ||||
} | } | ||||
public function getTagContent() { | protected function getTagContent() { | ||||
/* Center it in the middle of the selected area */ | /* Center it in the middle of the selected area */ | ||||
$center_x = round($this->centerX + ($this->maskW / 2)); | $center_x = round($this->centerX + ($this->maskW / 2)); | ||||
$center_y = round($this->centerY + ($this->maskH / 2)); | $center_y = round($this->centerY + ($this->maskH / 2)); | ||||
$center_x = round($center_x - ($this->displayWidth / 2)); | $center_x = round($center_x - ($this->displayWidth / 2)); | ||||
$center_y = round($center_y - ($this->displayHeight / 2)); | $center_y = round($center_y - ($this->displayHeight / 2)); | ||||
$center_x = -$center_x; | $center_x = -$center_x; | ||||
▲ Show 20 Lines • Show All 43 Lines • Show Last 20 Lines |