namespace Fluidbook\Tools\Links;
-class LayerLink extends ImageLink
-{
+use Illuminate\Support\Facades\Log;
+
+class LayerLink extends ImageLink {
protected $maxzoom_default = 4;
public $defaultZIndex = 31;
- public function ignore()
- {
+ public function ignore() {
return parent::ignore() || $this->isOutsidePage();
}
/**
* @throws \Exception
*/
- public function getCSS()
- {
+ public function getCSS() {
$attributes = $this->getZoomAttributes();
if (!$this->rightClone) {
ZoomLink::generateImage($attributes, $this->compiler, 'layerlink', 'layer');
}
}
- public function getImageUrl()
- {
+ public function getImageUrl() {
return 'data/links/layer_' . $this->uid . '.jpg';
}
- public function getZoomAttributes()
- {
+ public function getZoomAttributes() {
return [
'id' => $this->uid,
'page' => $this->page,
$y = $attributes['y'];
$w = $attributes['width'];
$h = $attributes['height'];
- $bookwidth = round($compiler->getSetting('width'));
+ $bookwidth = round($compiler->getWidthForLinks());
if (!isset($attributes['pdf']) || !$attributes['pdf']) {
$pdfpath = $compiler->getPagePDFSource($attributes['page']);
array('x' => $x, 'y' => $y, 'width' => $w, 'height' => $h),
null, $extractOptions, $cache);
+
if (($x + $w) > $bookwidth && !$compiler->isOnePage()) {
if (!isset($attributes['pdf']) || !$attributes['pdf']) {
$pdfpath = $compiler->getPagePDFSource($attributes['page'] + 1);