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 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. to `true` will replace the value of the attribute instead of adding it.
## Point.attr() signature
```js ```js
Point point.attr( Point point.attr(
string name, 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. 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 <Example
part="point_attr" part="point_attr"
caption="An example of the Point.attr() method" 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. Returns a new `Point` with the same coordinates and attributes as the original point.
## Point.clone() signature
```js ```js
Point point.clone() Point point.clone()
``` ```
@ -17,6 +19,8 @@ The [`Point.copy()`](reference/api/point/copy/) method will only copy the point'
</Note> </Note>
## Point.clone() example
<Example <Example
part="point_clone" part="point_clone"
caption="An example of the Point.clone() method" 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. 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. This method does _not_ copy any attributes the original point may have.
## Point.copy() signature
```js ```js
Point point.copy() Point point.copy()
``` ```
@ -17,6 +19,8 @@ To also copy the attributes, use [`Point.clone()`](reference/api/point/clone/) i
</Note> </Note>
## Point.copy() example
<Example <Example
part="point_copy" part="point_copy"
caption="An example of the Point.copy() method" 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. A point's `dist()` method returns the distance (in mm) between this point and the point you pass it.
## Point.dist() signature
```js ```js
float point.dist(Point point) float point.dist(Point point)
``` ```
## Point.dist() example
<Example <Example
part="point_dist" part="point_dist"
caption="An example of the Point.dist() method" 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. 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 ```js
float point.dx(Point point) float point.dx(Point point)
``` ```
## Point.dx() example
<Example <Example
part="point_dx" part="point_dx"
caption="An example of the Point.dx() method" 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. 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 ```js
float point.dy(Point point) float point.dy(Point point)
``` ```
## Point.dy() example
<Example <Example
part="point_dy" part="point_dy"
caption="An example of the Point.dy() method" 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. 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. If you do not pass in a point, it will default to mirroring around an X-value of zero.
## Point.flipX() signature
```js ```js
Point point.flipX(Point mirror = false) Point point.flipX(Point mirror = false)
``` ```
## Point.flipX() example
<Example <Example
part="point_flipx" part="point_flipx"
caption="An example of the Point.flipX() method" 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. 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. If you do not pass in a point, it will default to mirroring around an Y-value of zero.
## Point.flipY() signature
```js ```js
Point point.flipY(Point mirror = false) Point point.flipY(Point mirror = false)
``` ```
## Point.flipY() example
<Example <Example
part="point_flipy" part="point_flipy"
caption="An example of the Point.flipY() method" 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. 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 ```js
Point point.rotate(float angle, Point center) Point point.rotate(float angle, Point center)
``` ```
## Point.rotate() example
<Example <Example
part="point_rotate" part="point_rotate"
caption="An example of the Point.rotate() method" 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). 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. An angle of 0° points to the right, and the angle increases counterclockwise.
## Point.shift() signature
```js ```js
Point point.shift(float angle, float distance) Point point.shift(float angle, float distance)
``` ```
## Point.shift() example
<Example <Example
part="point_shift" part="point_shift"
caption="An example of the Point.shift() method" 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. 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 ```js
Point point.shiftFractionTowards(Point target, float fraction) Point point.shiftFractionTowards(Point target, float fraction)
``` ```
## Point.shiftFractionTowards() example
<Example <Example
part="point_shiftfractiontowards" part="point_shiftfractiontowards"
caption="An example of the Point.shiftFractionTowards() method" 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. Returns a new `Point` that is shifted `distance` (mm) beyond the `target` in the direction of the target point.
## Point.shiftOutwards() signature
```js ```js
Point point.shiftOutwards(Point target, float distance) Point point.shiftOutwards(Point target, float distance)
``` ```
## Point.shiftOutwards() example
<Example <Example
part="point_shiftoutwards" part="point_shiftoutwards"
caption="An example of the Point.shiftOutwards() method" 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. 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 ```js
Point point.shiftTowards(Point target, float distance) Point point.shiftTowards(Point target, float distance)
``` ```
## Point.shiftTowards() example
<Example <Example
part="point_shifttowards" part="point_shifttowards"
caption="An example of the Point.shiftTowards() method" caption="An example of the Point.shiftTowards() method"

View file

@ -16,10 +16,14 @@ millimeter, use [`Point.sitsRoughlyOn()`](/reference/api/point/sitsroughlyon/) i
</Note> </Note>
## Point.sitsOn() signature
```js ```js
bool point.sitsOn(Point check) bool point.sitsOn(Point check)
``` ```
## Point.sitsOn() example
<Example <Example
part="point_sitson" part="point_sitson"
caption="An example of the Point.sitsOn() method" 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. 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 ```js
bool point.sitsRoughlyOn(Point check) bool point.sitsRoughlyOn(Point check)
``` ```
@ -17,6 +19,8 @@ that this one rounds things down to the nearest integer (thus mm) before checkin
</Note> </Note>
## Point.sitsRoughlyOn() example
<Example <Example
part="point_sitsroughlyon" part="point_sitsroughlyon"
caption="An example of the Point.sitsRoughlyOn() method" 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. 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 ```js
Point point.translate(float deltaX, float deltaY) 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. Positive values for `deltaX` will move the point to the right. Positive values for `deltaY` will move the point downwards.
## Point.translate() example
<Example <Example
part="point_translate" part="point_translate"
caption="An example of the Point.translate() method" caption="An example of the Point.translate() method"