public function FocalPointManagerInterface::absoluteToRelative in Focal Point 8
Converts absolute focal point coordinates to relative coordinates.
Parameters
int $x: Absolute X coordinate of the focal point on the original image.
int $y: Absolute Y coordinate of the focal point on the original image.
int $width: Width of the original image.
int $height: Height of the original image.
Return value
array The relative coordinates of the focal point where each coordinate is a percentage. 'x' and 'y' are used for array keys and corresponding coordinates as values.
See also
relativeToAbsolute
1 method overrides FocalPointManagerInterface::absoluteToRelative()
- FocalPointManager::absoluteToRelative in src/
FocalPointManager.php - Converts absolute focal point coordinates to relative coordinates.
File
- src/
FocalPointManagerInterface.php, line 69
Class
- FocalPointManagerInterface
- Defines an interface for focal point manager.
Namespace
Drupal\focal_pointCode
public function absoluteToRelative($x, $y, $width, $height);