示例#1
0
  /**
   * {@inheritdoc}
   */
  public function saveCropEntity($x, $y, $width, $height, CropInterface $crop) {
    $absolute = $this->relativeToAbsolute($x, $y, $width, $height);

    $anchor = $crop->anchor();
    if ($anchor['x'] != $absolute['x'] || $anchor['y'] != $absolute['y']) {
      $crop->setPosition($absolute['x'], $absolute['y']);
      $crop->save();
    }

    return $crop;
  }