if (!$this->rightClone) {
zoomLink::generateImage($attributes, $this->compiler, 'layerlink', 'layer');
}
- return 'background-image:url(' . $this->getImageUrl() . ');background-size:100% 100%;background-repeat:no-repeat;';
+ return 'background-image:url(' . $this->getImageUrl() . ');background-size:' . $this->getBackgroundSize() . ';background-position:' . $this->getBackgroundPosition() . ';background-repeat:no-repeat;';
}
public function getImageUrl()
public function getCSS()
{
- return 'background-color:' . wsHTML5::colorToCSS($this->to, 1) . ';';
+ $res = parent::getCSS();
+ $res .= 'background-color:' . wsHTML5::colorToCSS($this->to, 1) . ';';
+ return $res;
}
public function getAdditionnalContent()
}
$fz = $this->height * $this->getCssScale();
$fz = round($fz / $font['capHeight'], 2);
- return 'line-height:' . $font['capHeight'] . ';font-size:' . $fz . 'px;font-family:' . $font['family'] . ';color:' . wsHTML5::colorToCSS($this->extra, 1) . ';';
+ $res = parent::getCSS();
+ $res .= 'line-height:' . $font['capHeight'] . ';font-size:' . $fz . 'px;font-family:' . $font['family'] . ';color:' . wsHTML5::colorToCSS($this->extra, 1) . ';';
+ return $res;
}
public function getHTMLContainerClass()
public function getCSS()
{
+ $res = parent::getCSS();
$this->copyExternalFile($this->to);
- return 'background-image:url(' . $this->getImageUrl() . ');background-size:100% 100%;background-repeat:no-repeat;';
+ $res .= 'background-image:url(' . $this->getImageUrl() . ');background-size:' . $this->getBackgroundSize() . ';background-position:' . $this->getBackgroundPosition() . ';background-repeat:no-repeat;';
+ return $res;
+ }
+
+ public function getBackgroundPosition()
+ {
+ $animations = self::parseAnimations($this->image_rollover);
+ foreach ($animations as $animation) {
+ if (($animation['type'] === 'zoomout' || $animation['type'] === 'zoomin') && isset($animation['transformorigin'])) {
+ return $animation['transformorigin'];
+ }
+ }
+ return '50% 50%';
+ }
+
+ public function getBackgroundSize()
+ {
+
+ $size = '100%';
+ $animations = self::parseAnimations($this->image_rollover);
+ foreach ($animations as $animation) {
+ if ($animation['type'] === 'zoomout') {
+ $size = round($animation['scale'] * 100) . '%';
+ }
+ }
+ return $size . ' ' . $size;
}
public function getAdditionnalContent()