@pixerate/editor 0.216.0 → 0.218.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-WJ2RBZMM.js → chunk-HLBTRSQJ.js} +24 -0
- package/dist/{chunk-KWNMBMKG.cjs → chunk-XFYLA3ZO.cjs} +25 -1
- package/dist/image-editor/controller.d.cts +33 -0
- package/dist/image-editor/controller.d.ts +33 -0
- package/dist/image-editor/index.cjs +816 -567
- package/dist/image-editor/index.js +252 -3
- package/dist/image-editor/renderer.d.cts +2 -0
- package/dist/image-editor/renderer.d.ts +2 -0
- package/dist/image-editor/selection/diff.d.cts +59 -0
- package/dist/image-editor/selection/diff.d.ts +59 -0
- package/dist/image-editor/selection/index.d.cts +1 -0
- package/dist/image-editor/selection/index.d.ts +1 -0
- package/dist/image-editor/types.d.cts +9 -0
- package/dist/image-editor/types.d.ts +9 -0
- package/dist/paint/index.cjs +4 -2
- package/dist/paint/index.js +3 -1
- package/dist/paint/wet/world.d.cts +19 -0
- package/dist/paint/wet/world.d.ts +19 -0
- package/dist/paint-editor/controller.d.cts +5 -3
- package/dist/paint-editor/controller.d.ts +5 -3
- package/dist/paint-editor/index.cjs +203 -148
- package/dist/paint-editor/index.js +72 -17
- package/dist/paint-editor/wet.d.cts +14 -0
- package/dist/paint-editor/wet.d.ts +14 -0
- package/package.json +1 -1
- package/skills/pixerate-image-editor/SKILL.md +2 -2
- package/skills/pixerate-image-selection-masking/SKILL.md +3 -3
- package/skills/pixerate-paint-editor/SKILL.md +1 -1
|
@@ -385,4 +385,23 @@ export declare class WetWorld {
|
|
|
385
385
|
/** Float index of a slot's first plane (tests). */
|
|
386
386
|
slotIndex(id: string, tx: number, ty: number): number;
|
|
387
387
|
}
|
|
388
|
+
/** A layer's base and flow map in a moved snapshot (see `moveWetSnapshot`). */
|
|
389
|
+
export interface WetSnapshotLaneMove {
|
|
390
|
+
base?: TiledSurface;
|
|
391
|
+
flow?: WetFlowField | null;
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* `snap`, taken from a world `from` pixels in size, moved by (`dx`, `dy`) pixels for a world `to`
|
|
395
|
+
* pixels in size (a canvas grown on any side): every wet tile, with its water, pigment and
|
|
396
|
+
* deposits, lands `dx` / `dy` further right / down. The shift has to be whole wet tiles
|
|
397
|
+
* (`WET_TILE`); tiles that land outside `to` are dropped. `lane` gives each layer's base and flow
|
|
398
|
+
* map in the new coordinates (default: as they were). Restore it into a world of `to`'s size.
|
|
399
|
+
*/
|
|
400
|
+
export declare function moveWetSnapshot(snap: WetSnapshot, from: {
|
|
401
|
+
width: number;
|
|
402
|
+
height: number;
|
|
403
|
+
}, to: {
|
|
404
|
+
width: number;
|
|
405
|
+
height: number;
|
|
406
|
+
}, dx: number, dy: number, lane?: (l: WetSnapshot['lanes'][number]) => WetSnapshotLaneMove): WetSnapshot;
|
|
388
407
|
export {};
|
|
@@ -360,9 +360,11 @@ export declare class PaintEditorController {
|
|
|
360
360
|
* move by (left, top) in document pixels, `document.origin` moves by (−left, −top), and the view
|
|
361
361
|
* pans so the picture stays still on screen.
|
|
362
362
|
*
|
|
363
|
-
* Wet paint
|
|
364
|
-
* (
|
|
365
|
-
*
|
|
363
|
+
* Wet paint stays wet and moves with the picture when `left` and `top` are whole 256 px tiles
|
|
364
|
+
* (so a host growing a canvas while someone paints should grow it in tile steps); otherwise it
|
|
365
|
+
* dries first (the wet simulation is canvas-sized), as with `setCanvas`. One undo step (undo
|
|
366
|
+
* brings back the old size, origin and guides, and the wet paint). Returns the new canvas, where
|
|
367
|
+
* it sits in the previous document's pixels, and the origin.
|
|
366
368
|
*/
|
|
367
369
|
extendCanvas(by: PaintCanvasExtension): PaintCanvasExtended;
|
|
368
370
|
/** Changes the paper: a library preset (`preset`), and / or any of its settings (one undo step). */
|
|
@@ -360,9 +360,11 @@ export declare class PaintEditorController {
|
|
|
360
360
|
* move by (left, top) in document pixels, `document.origin` moves by (−left, −top), and the view
|
|
361
361
|
* pans so the picture stays still on screen.
|
|
362
362
|
*
|
|
363
|
-
* Wet paint
|
|
364
|
-
* (
|
|
365
|
-
*
|
|
363
|
+
* Wet paint stays wet and moves with the picture when `left` and `top` are whole 256 px tiles
|
|
364
|
+
* (so a host growing a canvas while someone paints should grow it in tile steps); otherwise it
|
|
365
|
+
* dries first (the wet simulation is canvas-sized), as with `setCanvas`. One undo step (undo
|
|
366
|
+
* brings back the old size, origin and guides, and the wet paint). Returns the new canvas, where
|
|
367
|
+
* it sits in the previous document's pixels, and the origin.
|
|
366
368
|
*/
|
|
367
369
|
extendCanvas(by: PaintCanvasExtension): PaintCanvasExtended;
|
|
368
370
|
/** Changes the paper: a library preset (`preset`), and / or any of its settings (one undo step). */
|