1
0
Fork 0

Merge branch 'develop' into spellcheck-typos-fix

This commit is contained in:
Joost De Cock 2022-12-15 17:55:47 +01:00 committed by GitHub
commit f51e69d6af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 367 additions and 232 deletions

View file

@ -32,6 +32,7 @@ access the following properties:
| `sa` | Access to `settings.sa` |
| `scale` | Access to `settings.scale` |
|| **_Access to utilities_** |
| `context` | The pattern context |
| `getId` | See [the getId documentation](/reference/api/part/getid) |
| `hide` | See [the hide documentation](/reference/api/part/hide) |
| `log` | See [the logging documentation](/reference/api/store/log) |

View file

@ -46,9 +46,11 @@ Path path.attr(
## Notes
Methods like
[`Path.addClass`](/reference/api/path/addclass),
[`Path.setClass`](/reference/api/path/setclass),
[`Path.adddText`](/reference/api/path/addtext), and
[`Path.addClass`](/reference/api/path/addclass),
[`Path.setClass`](/reference/api/path/setclass),
[`Path.addText`](/reference/api/path/addtext), and
[`Path.setText`](/reference/api/path/settext)
all call this method under the hood.
See [Using Attributes](/howtos/code/attributes)
for information about custom Attributes that can be used with Paths.

View file

@ -12,7 +12,7 @@ Path new Path()
The Path constructor takes no arguments.
## Attributes
## Properties
A Path objects comes with the following properties:
@ -24,6 +24,10 @@ A Path objects comes with the following properties:
[Path.setHidden()](/reference/api/path/sethidden) for various methods that
allow setting this in a chainable way.
<Related>
See [Using Attributes](/howtos/code/attributes)
for information about custom Attributes that can be used with Paths.
</Related>
## Example
<Example caption="Example of the Path contructor">

View file

@ -42,3 +42,7 @@ If the third parameter is set to `true` it will call [`this.attributes.set()`](/
```
</Example>
## Notes
See [Using Attributes](/howtos/code/attributes)
for information about custom Attributes that can be used with Points.

View file

@ -15,7 +15,7 @@ The point constructor takes two arguments:
- `x` : The X-coordinate of the point
- `y` : The Y-coordinate of the point
## Attributes
## Properties
Point objects come with the following properties:
@ -23,6 +23,11 @@ Point objects come with the following properties:
- `y` : The Y-coordinate of the point
- `attributes` : An [Attributes](/reference/api/attributes) instance holding the point's attributes
<Related>
See [Using Attributes](/howtos/code/attributes)
for information about custom Attributes that can be used with Points.
</Related>
## Example
<Example caption="Example of the Point constructor">

View file

@ -41,3 +41,7 @@ Snippet snippet.attr(
```
</Example>
<Related>
See [Using Attributes](/howtos/code/attributes)
for information about what Attributes can be used with Snippets.
</Related>

View file

@ -2,21 +2,21 @@
title: Snippet
---
A Snippet is a reusable bit of markup for your pattern. They are added to the
A Snippet is a reusable bit of markup for your pattern. Snippets are added to the
SVG `defs` section, and rendered with the SVG `use` tag.
## Signature
```js
Snippet new Snippet(def, Point);
Snippet new Snippet(String def, Point anchor);
```
The snippet constructor takes two arguments:
- `def` : The `xlink:href` id that links to the relevant entry in the SVG `defs` section
- `def` : The `xlink:href` id that links to the relevant entry in the SVG `defs` section. This is also the common name of the snippet (`logo`, `notch`, `button`, etc.)
- `anchor` : A [`Point`](/reference/api/point) on which to anchor the snippet
## Attributes
## Properties
A Snippet object comes with the following properties:
@ -24,6 +24,11 @@ A Snippet object comes with the following properties:
- `anchor` : A [`Point`](/reference/api/point) on which to anchor the snippet
- `attributes` : An [`Attributes`](/reference/api/attributes) instance holding the snippet's attributes
<Related>
See [Using Attributes](/howtos/code/attributes)
for information about custom Attributes that can be used with Snippets.
</Related>
## Example
<Example caption="Example of the Snippet constructor">