@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.
@@ -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 dries first (the wet simulation is canvas-sized), as with `setCanvas`; one undo step
364
- * (undo brings back the old size, origin and guides, and the wet paint). Returns the new canvas,
365
- * where it sits in the previous document's pixels, and the origin.
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 dries first (the wet simulation is canvas-sized), as with `setCanvas`; one undo step
364
- * (undo brings back the old size, origin and guides, and the wet paint). Returns the new canvas,
365
- * where it sits in the previous document's pixels, and the origin.
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). */