@pixelvibing/cli 0.43.0 → 0.45.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.
@@ -3854,8 +3854,8 @@ function sentSketch(sketch, description) {
3854
3854
  function sketchSendProblem(sketch, description) {
3855
3855
  return sketchProblem(sentSketch(sketch, description));
3856
3856
  }
3857
- function sketchBody(sketch, description) {
3858
- return { ...sentSketch(sketch, description) };
3857
+ function sketchBody(sketch, description, pixelArt = true) {
3858
+ return { ...sentSketch(sketch, description), ...pixelArt ? {} : { pixelArt: false } };
3859
3859
  }
3860
3860
  function usageOf$1(billing) {
3861
3861
  return billing.usage ?? { used: 0, limit: billing.credits };
@@ -3920,13 +3920,24 @@ function gridForCells(cols, rows, cellsPerTile = CELLS_PER_TILE) {
3920
3920
  for (let cell = MAX_CELL - 1; cell >= MIN_CELL; cell -= 1) if (drawn(cell) && unscaled(cell)) return canvas(cell);
3921
3921
  return null;
3922
3922
  }
3923
+ const LEAST_CELLS_PER_TILE = 16;
3924
+ function cellCounts(cellsPerTile) {
3925
+ const counts = [cellsPerTile];
3926
+ for (let cells = cellsPerTile / 2; Number.isInteger(cells) && cells >= LEAST_CELLS_PER_TILE; cells /= 2) counts.push(cells);
3927
+ return counts;
3928
+ }
3923
3929
  function gridCanvas(footprint, cellsPerTile = CELLS_PER_TILE) {
3924
- return gridForCells(footprint.cols * cellsPerTile, footprint.rows * cellsPerTile, cellsPerTile);
3930
+ for (const cells of cellCounts(cellsPerTile)) {
3931
+ const canvas = gridForCells(footprint.cols * cells, footprint.rows * cells, cells);
3932
+ if (canvas !== null) return canvas;
3933
+ }
3934
+ return null;
3925
3935
  }
3926
3936
  function gridProblem(footprint, cellsPerTile = CELLS_PER_TILE) {
3927
3937
  if (gridCanvas(footprint, cellsPerTile) !== null) return null;
3928
- const side = Math.floor(ROUTE_MAX_EDGE / (cellsPerTile * MIN_CELL));
3929
- const area = Math.floor(ROUTE_MAX_PIXELS / (cellsPerTile * MIN_CELL) ** 2);
3938
+ const least = cellCounts(cellsPerTile).at(-1);
3939
+ const side = Math.floor(ROUTE_MAX_EDGE / (least * MIN_CELL));
3940
+ const area = Math.floor(ROUTE_MAX_PIXELS / (least * MIN_CELL) ** 2);
3930
3941
  return `a ${footprint.cols}×${footprint.rows} tile object is too large to draw on the grid: at most ${side} tile${side === 1 ? "" : "s"} on a side and ${area} tile${area === 1 ? "" : "s"} in all`;
3931
3942
  }
3932
3943
  function designCanvas(tiles) {
@@ -4605,7 +4616,7 @@ const move = {
4605
4616
  );
4606
4617
  }
4607
4618
  };
4608
- const version = "0.43.0";
4619
+ const version = "0.45.0";
4609
4620
  const manifest = {
4610
4621
  version
4611
4622
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pixelvibing/cli",
3
- "version": "0.43.0",
3
+ "version": "0.45.0",
4
4
  "description": "PixelVibing: pixel art game assets from the command line, and the Skills that teach coding assistants to make them.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://pixelvibing.com",