Skip to content

Commit 2686a91

Browse files
committed
name cropCircle's size option of 3.x as fit in the changelog and guide
1 parent 66a1a83 commit 2686a91

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Upgrading from 3.x? Upgrade to the latest 3.x release first, fix the deprecation
2222

2323
- **`PNGMetadata` is removed**: use `Metadata`, which the encoders that write metadata take. The type is the same.
2424

25-
- **The `max` argument of `cropCircle()` is removed**: `cropCircle(true, feathering)` and `cropCircle({ max: true })` are now `cropCircle({ fit: 'cover', feathering })`, and `cropCircle(false)` is `cropCircle()`, the default `fit: 'contain'`.
25+
- **The `max` argument of `cropCircle()` is removed**: `cropCircle(true, feathering)` and `cropCircle({ max: true })` are now `cropCircle({ fit: 'cover', feathering })`, and `cropCircle(false)` is `cropCircle()`, the default `fit: 'contain'`. The `size` option that 3.x added for it (and that 3.x's deprecation hint suggests) is `fit` too: `cropCircle({ size: 'cover' })` is `cropCircle({ fit: 'cover' })`, and `size` is ignored like any key that isn't an option.
2626

2727
- **The positional forms of `Image.renderText()` are removed**: `Image.renderText(font, size, text, color?, layout?, style?)` and `Image.renderText(font, size, text, options?)` are now `Image.renderText(text, { font, size, color, ...layout, ...style })`.
2828

‎guides/Migrating to 4.0.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,12 +477,14 @@ Each of them extends the options of the format's still images: `GIFAnimationEnco
477477
| `image.cropCircle(true, feathering)` | `image.cropCircle({ fit: 'cover', feathering })` |
478478
| `image.cropCircle(false)` | `image.cropCircle()`, the default `fit: 'contain'` |
479479
| `image.cropCircle({ max: true })` | `image.cropCircle({ fit: 'cover' })` |
480+
| `image.cropCircle({ size: 'cover' })` (what 3.x's deprecation hint suggests) | `image.cropCircle({ fit: 'cover' })` |
480481
| `PNGMetadata` (type) | `Metadata`, which the encoders that write metadata take |
481482

482483
`renderText()` takes the text first. The font, the size, the color, the layout options ([`TextLayoutOptions`](https://imagescript.dev/interfaces/TextLayoutOptions.html)) and
483484
the style are all in the one options object, documented in [`RenderTextOptions`](https://imagescript.dev/interfaces/RenderTextOptions.html). Crop options are in
484485
[`CropCircleOptions`](https://imagescript.dev/interfaces/CropCircleOptions.html). A key that is not an option is ignored without an error, so
485-
`cropCircle({ max: true })` quietly becomes the default `contain`: change it to `fit: 'cover'`.
486+
`cropCircle({ max: true })` and `cropCircle({ size: 'cover' })`, the form 3.x's deprecation hint suggests, quietly become
487+
the default `contain`: change them to `fit: 'cover'`.
486488

487489
### Positional arguments
488490

0 commit comments

Comments
 (0)