1
0
Fork 0

add subheadings for consistency

This commit is contained in:
Sanne Kalkman 2021-11-06 19:03:54 +01:00
parent fbd4b4d5f2
commit 1a7ae1d669
16 changed files with 64 additions and 0 deletions

View file

@ -5,6 +5,8 @@ title: Point.attr()
Adds an attribute to the point, and returns the original point. Setting the third parameter
to `true` will replace the value of the attribute instead of adding it.
## Point.attr() signature
```js
Point point.attr(
string name,
@ -18,6 +20,8 @@ This allows you to chain different calls together as in the example below.
If the third parameter is set to `true` it will call [`this.attributes.set()`](/reference/api/attributes/set/) instead, thereby overwriting the value of the attribute.
## Point.attr() example
<Example
part="point_attr"
caption="An example of the Point.attr() method"

View file

@ -4,6 +4,8 @@ title: Point.clone()
Returns a new `Point` with the same coordinates and attributes as the original point.
## Point.clone() signature
```js
Point point.clone()
```
@ -17,6 +19,8 @@ The [`Point.copy()`](reference/api/point/copy/) method will only copy the point'
</Note>
## Point.clone() example
<Example
part="point_clone"
caption="An example of the Point.clone() method"

View file

@ -4,6 +4,8 @@ title: Point.copy()
A point's `copy()` method returns a new point with the same coordinates as the original point.
This method does _not_ copy any attributes the original point may have.
## Point.copy() signature
```js
Point point.copy()
```
@ -17,6 +19,8 @@ To also copy the attributes, use [`Point.clone()`](reference/api/point/clone/) i
</Note>
## Point.copy() example
<Example
part="point_copy"
caption="An example of the Point.copy() method"

View file

@ -4,10 +4,14 @@ title: Point.dist()
A point's `dist()` method returns the distance (in mm) between this point and the point you pass it.
## Point.dist() signature
```js
float point.dist(Point point)
```
## Point.dist() example
<Example
part="point_dist"
caption="An example of the Point.dist() method"

View file

@ -4,10 +4,14 @@ title: Point.dx()
A point's `dx()` method returns the delta (in mm) along the X-axis between this point and the point you pass it.
## Point.dx() signature
```js
float point.dx(Point point)
```
## Point.dx() example
<Example
part="point_dx"
caption="An example of the Point.dx() method"

View file

@ -4,10 +4,14 @@ title: Point.dy()
A point's `dy()` method returns the delta (in mm) along the Y-axis between this point and the point you pass it.
## Point.dy() signature
```js
float point.dy(Point point)
```
## Point.dy() example
<Example
part="point_dy"
caption="An example of the Point.dy() method"

View file

@ -5,10 +5,14 @@ title: Point.flipX()
A point's `flipX()` method returns a new `Point` that mirrors the original point around the X-value of the point you pass it.
If you do not pass in a point, it will default to mirroring around an X-value of zero.
## Point.flipX() signature
```js
Point point.flipX(Point mirror = false)
```
## Point.flipX() example
<Example
part="point_flipx"
caption="An example of the Point.flipX() method"

View file

@ -5,10 +5,14 @@ title: Point.flipY()
A point's `flipY()` method returns a new `Point` that mirrors the original point around the Y-value of the point you pass it.
If you do not pass in a point, it will default to mirroring around an Y-value of zero.
## Point.flipY() signature
```js
Point point.flipY(Point mirror = false)
```
## Point.flipY() example
<Example
part="point_flipy"
caption="An example of the Point.flipY() method"

View file

@ -7,10 +7,14 @@ around the point (`center`) that you pass it.
Just like the result of the [`Point.angle()`](reference/api/point/angle/) method, an angle of 0° points right, and the angle increases counterclockwise.
## Point.rotate() signature
```js
Point point.rotate(float angle, Point center)
```
## Point.rotate() example
<Example
part="point_rotate"
caption="An example of the Point.rotate() method"

View file

@ -5,10 +5,14 @@ title: Point.shift()
Returns a new `Point` that is `distance` (mm) away in the direction of `angle` (degrees).
An angle of 0° points to the right, and the angle increases counterclockwise.
## Point.shift() signature
```js
Point point.shift(float angle, float distance)
```
## Point.shift() example
<Example
part="point_shift"
caption="An example of the Point.shift() method"

View file

@ -10,10 +10,14 @@ point in the opposite direction.
If you need to move a point by a specific distance instead of a percentage, use [`Point.shiftTowards()`]((reference/api/point/shifttowards/)) or [`Point.shiftOutwards()`](reference/api/point/shiftoutwards/) instead.
## Point.shiftFractionTowards() signature
```js
Point point.shiftFractionTowards(Point target, float fraction)
```
## Point.shiftFractionTowards() example
<Example
part="point_shiftfractiontowards"
caption="An example of the Point.shiftFractionTowards() method"

View file

@ -4,10 +4,14 @@ title: Point.shiftOutwards()
Returns a new `Point` that is shifted `distance` (mm) beyond the `target` in the direction of the target point.
## Point.shiftOutwards() signature
```js
Point point.shiftOutwards(Point target, float distance)
```
## Point.shiftOutwards() example
<Example
part="point_shiftoutwards"
caption="An example of the Point.shiftOutwards() method"

View file

@ -6,10 +6,14 @@ Returns a new `Point` that is shifted `distance` (mm) in the direction of the `t
If you need to move a point a percentage instead of a specific distance, use [`Point.shiftFractionTowards()`](reference/api/point/shiftfractiontowards/) instead.
## Point.shiftTowards() signature
```js
Point point.shiftTowards(Point target, float distance)
```
## Point.shiftTowards() example
<Example
part="point_shifttowards"
caption="An example of the Point.shiftTowards() method"

View file

@ -16,10 +16,14 @@ millimeter, use [`Point.sitsRoughlyOn()`](/reference/api/point/sitsroughlyon/) i
</Note>
## Point.sitsOn() signature
```js
bool point.sitsOn(Point check)
```
## Point.sitsOn() example
<Example
part="point_sitson"
caption="An example of the Point.sitsOn() method"

View file

@ -4,6 +4,8 @@ title: Point.sitsRoughlyOn()
Returns `true` if this point has roughly (rounded to the nearest millimeter) the same coordinates as the one you pass to it.
## Point.sitsRoughlyOn() signature
```js
bool point.sitsRoughlyOn(Point check)
```
@ -17,6 +19,8 @@ that this one rounds things down to the nearest integer (thus mm) before checkin
</Note>
## Point.sitsRoughlyOn() example
<Example
part="point_sitsroughlyon"
caption="An example of the Point.sitsRoughlyOn() method"

View file

@ -4,6 +4,8 @@ title: Point.translate()
Returns a new `Point` with a [translate transform](https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/translate) applied.
## Point.translate() signature
```js
Point point.translate(float deltaX, float deltaY)
```
@ -15,6 +17,8 @@ In other words, this will:
Positive values for `deltaX` will move the point to the right. Positive values for `deltaY` will move the point downwards.
## Point.translate() example
<Example
part="point_translate"
caption="An example of the Point.translate() method"