You are here

public function ImageHotspot::setCoordinates in Image Hotspots 8

Sets new coordinates for hotspot.

Parameters

array $coordinates: Array with X and Y keys for new coordinates.

Overrides ImageHotspotInterface::setCoordinates

File

src/Entity/ImageHotspot.php, line 122

Class

ImageHotspot
Defines the image hotspot entity class.

Namespace

Drupal\image_hotspots\Entity

Code

public function setCoordinates(array $coordinates) {
  $this->x->value = $coordinates['x'];
  $this->y->value = $coordinates['y'];
  $this->x2->value = $coordinates['x2'];
  $this->y2->value = $coordinates['y2'];
}