#68 - reply working + remove marker on comment delete

This commit is contained in:
isUnknown 2024-12-18 18:22:41 +01:00
parent cf83edc1e6
commit 231bb21a4f
9 changed files with 64 additions and 95 deletions

View file

@ -5,21 +5,28 @@ namespace adrienpayet\D2P\data;
class Position
{
public int $pageIndex;
public float $x;
public float $y;
public ?float $x = null;
public ?float $y = null;
public function __construct(array $data)
{
$this->pageIndex = $data['pageIndex'];
$this->x = (float) $data['x'];
$this->y = (float) $data['y'];
if (isset($data["x"])) {
$this->x = (float) $data['x'];
$this->y = (float) $data['y'];
}
}
public function toArray() {
return [
$array = [
"pageIndex" => $this->pageIndex,
"x" => $this->x,
"y" => $this->y,
];
if ($this->x) {
$array["x"] = $this->x;
$array["y"] = $this->y;
}
return $array;
}
}