dever 6 years ago
parent
commit
bfefdc7970
1 changed files with 10 additions and 0 deletions
  1. 10 0
      src/Lib/Img.php

+ 10 - 0
src/Lib/Img.php

@@ -1432,12 +1432,14 @@ class Img
     private function _get_mark($source_x, $source_y, $water_x, $water_y, $type = 'mark')
     {
         $this->_check($type, 'position');
+        $this->_check($type, 'offset');
         $l = 0;
         $t = 0;
         $state = true;
 
         $method = '_' . $type;
         $position = $this->{$method}['position'];
+        $offset = $this->{$method}['offset'];
         if ($position && is_array($position)) {
             $l = $position[0];
             $t = $position[1];
@@ -1478,6 +1480,14 @@ class Img
                     break;
             }
         }
+
+        if ($offset && is_array($offset)) {
+            $l = $l + $offset[0];
+            $t = $t + $offset[1];
+        } else {
+            $l = $l + $offset;
+            $t = $t + $offset;
+        }
         return array($l, $t, $state);
     }