You are here

public function FocalPointManagerInterface::relativeToAbsolute in Focal Point 8

Converts relative focal point coordinates to absolute coordinates.

Absolute coordinates are always specified in the context of the original image. Relative coordinates are percentages from the top left of the image so that using 50 for both x and y would mean to put the focal point in the center of the image.

Parameters

float $x: Relative X coordinate of the focal point. Maximum is 100.

float $y: Relative Y coordinate of the focal point. Maximum is 100.

int $width: Width of the original image.

int $height: Height of the original image.

Return value

array The absolute coordinates of the focal point on the original image. 'x' and 'y' are used for array keys and corresponding coordinates as values.

See also

absoluteToRelative

1 method overrides FocalPointManagerInterface::relativeToAbsolute()
FocalPointManager::relativeToAbsolute in src/FocalPointManager.php
Converts relative focal point coordinates to absolute coordinates.

File

src/FocalPointManagerInterface.php, line 48

Class

FocalPointManagerInterface
Defines an interface for focal point manager.

Namespace

Drupal\focal_point

Code

public function relativeToAbsolute($x, $y, $width, $height);