2021-10-17 17:34:55 +02:00
|
|
|
***
|
|
|
|
|
|
|
|
## title: copy()
|
2021-08-25 16:09:31 +02:00
|
|
|
|
|
|
|
```js
|
|
|
|
Point point.copy()
|
|
|
|
```
|
|
|
|
|
|
|
|
Returns a new point with the same coordinates as this point.
|
|
|
|
|
|
|
|
<Example
|
2021-10-17 17:34:55 +02:00
|
|
|
part="point_copy"
|
|
|
|
caption="An example of the Point.copy() method"
|
2021-08-25 16:09:31 +02:00
|
|
|
/>
|
|
|
|
|
|
|
|
```js
|
|
|
|
let { Point, points, Snippet, snippets } = part.shorthand();
|
|
|
|
|
|
|
|
points.A = new Point(50, 25)
|
|
|
|
.attr("data-text", "Point A")
|
|
|
|
.attr("data-text-class", "text-xl");
|
|
|
|
points.B = points.A.copy().attr("data-text", "Point B");
|
|
|
|
|
|
|
|
snippets.x = new Snippet("notch", points.A);
|
|
|
|
```
|