@fieldnotes/core 0.8.9 → 0.8.10
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/index.cjs +15 -20
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +15 -20
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1574,22 +1574,17 @@ function createHexGridTile(cellSize, orientation, strokeColor, strokeWidth, opac
|
|
|
1574
1574
|
tc.stroke();
|
|
1575
1575
|
return { canvas, tileW, tileH };
|
|
1576
1576
|
}
|
|
1577
|
-
function renderHexGridTiled(ctx, bounds, cellSize, tile
|
|
1578
|
-
const
|
|
1579
|
-
|
|
1580
|
-
const
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
bounds.minY - pad,
|
|
1589
|
-
bounds.maxX - bounds.minX + pad * 2,
|
|
1590
|
-
bounds.maxY - bounds.minY + pad * 2
|
|
1591
|
-
);
|
|
1592
|
-
ctx.restore();
|
|
1577
|
+
function renderHexGridTiled(ctx, bounds, cellSize, tile) {
|
|
1578
|
+
const { tileW, tileH } = tile;
|
|
1579
|
+
const startCol = Math.floor(bounds.minX / tileW) - 1;
|
|
1580
|
+
const endCol = Math.ceil(bounds.maxX / tileW) + 1;
|
|
1581
|
+
const startRow = Math.floor(bounds.minY / tileH) - 1;
|
|
1582
|
+
const endRow = Math.ceil(bounds.maxY / tileH) + 1;
|
|
1583
|
+
for (let row = startRow; row <= endRow; row++) {
|
|
1584
|
+
for (let col = startCol; col <= endCol; col++) {
|
|
1585
|
+
ctx.drawImage(tile.canvas, col * tileW, row * tileH, tileW, tileH);
|
|
1586
|
+
}
|
|
1587
|
+
}
|
|
1593
1588
|
}
|
|
1594
1589
|
|
|
1595
1590
|
// src/elements/element-renderer.ts
|
|
@@ -1800,7 +1795,7 @@ var ElementRenderer = class {
|
|
|
1800
1795
|
scale
|
|
1801
1796
|
);
|
|
1802
1797
|
if (tile) {
|
|
1803
|
-
renderHexGridTiled(ctx, bounds, grid.cellSize, tile
|
|
1798
|
+
renderHexGridTiled(ctx, bounds, grid.cellSize, tile);
|
|
1804
1799
|
} else {
|
|
1805
1800
|
renderHexGrid(
|
|
1806
1801
|
ctx,
|
|
@@ -3187,7 +3182,7 @@ var RenderLoop = class {
|
|
|
3187
3182
|
const gridCacheHit = this.gridCacheCanvas !== null && currentZoom === this.gridCacheZoom && currentCamX === this.gridCacheCamX && currentCamY === this.gridCacheCamY && cssWidth === this.gridCacheWidth && cssHeight === this.gridCacheHeight && gridRef === this.lastGridRef;
|
|
3188
3183
|
if (gridCacheHit) {
|
|
3189
3184
|
ctx.save();
|
|
3190
|
-
ctx.setTransform(
|
|
3185
|
+
ctx.setTransform(1, 0, 0, 1, 0, 0);
|
|
3191
3186
|
ctx.drawImage(this.gridCacheCanvas, 0, 0);
|
|
3192
3187
|
ctx.restore();
|
|
3193
3188
|
} else {
|
|
@@ -3204,7 +3199,7 @@ var RenderLoop = class {
|
|
|
3204
3199
|
}
|
|
3205
3200
|
gc.restore();
|
|
3206
3201
|
ctx.save();
|
|
3207
|
-
ctx.setTransform(
|
|
3202
|
+
ctx.setTransform(1, 0, 0, 1, 0, 0);
|
|
3208
3203
|
ctx.drawImage(this.gridCacheCanvas, 0, 0);
|
|
3209
3204
|
ctx.restore();
|
|
3210
3205
|
} else {
|
|
@@ -4923,7 +4918,7 @@ var UpdateLayerCommand = class {
|
|
|
4923
4918
|
};
|
|
4924
4919
|
|
|
4925
4920
|
// src/index.ts
|
|
4926
|
-
var VERSION = "0.8.
|
|
4921
|
+
var VERSION = "0.8.10";
|
|
4927
4922
|
// Annotate the CommonJS export names for ESM import in node:
|
|
4928
4923
|
0 && (module.exports = {
|
|
4929
4924
|
AddElementCommand,
|
package/dist/index.d.cts
CHANGED
|
@@ -930,6 +930,6 @@ declare class UpdateLayerCommand implements Command {
|
|
|
930
930
|
undo(_store: ElementStore): void;
|
|
931
931
|
}
|
|
932
932
|
|
|
933
|
-
declare const VERSION = "0.8.
|
|
933
|
+
declare const VERSION = "0.8.10";
|
|
934
934
|
|
|
935
935
|
export { AddElementCommand, type ArrowElement, ArrowTool, type ArrowToolOptions, AutoSave, type AutoSaveOptions, Background, type BackgroundOptions, type BackgroundPattern, BatchCommand, type Binding, type Bounds, Camera, type CameraChangeInfo, type CameraOptions, type CanvasElement, type CanvasState, type Command, CreateLayerCommand, ElementRenderer, ElementStore, type ElementType, type ElementUpdateEvent, EraserTool, type EraserToolOptions, EventBus, type ExportImageOptions, type GridElement, HandTool, type HexOrientation, HistoryRecorder, HistoryStack, type HistoryStackOptions, type HtmlElement, type ImageElement, ImageTool, type ImageToolOptions, InputHandler, type Layer, LayerManager, NoteEditor, type NoteElement, NoteTool, type NoteToolOptions, PencilTool, type PencilToolOptions, type Point, type PointerState, Quadtree, RemoveElementCommand, RemoveLayerCommand, type RenderStatsSnapshot, SelectTool, type ShapeElement, type ShapeKind, ShapeTool, type ShapeToolOptions, type Size, type StrokeElement, type StrokePoint, type TextElement, TextTool, type TextToolOptions, type Tool, type ToolContext, ToolManager, type ToolName, UpdateElementCommand, UpdateLayerCommand, VERSION, Viewport, type ViewportOptions, boundsIntersect, clearStaleBindings, createArrow, createGrid, createHtmlElement, createId, createImage, createNote, createShape, createStroke, createText, exportImage, exportState, findBindTarget, findBoundArrows, getArrowBounds, getArrowControlPoint, getArrowMidpoint, getArrowTangentAngle, getBendFromPoint, getEdgeIntersection, getElementBounds, getElementCenter, isBindable, isNearBezier, parseState, snapPoint, unbindArrow, updateBoundArrow };
|
package/dist/index.d.ts
CHANGED
|
@@ -930,6 +930,6 @@ declare class UpdateLayerCommand implements Command {
|
|
|
930
930
|
undo(_store: ElementStore): void;
|
|
931
931
|
}
|
|
932
932
|
|
|
933
|
-
declare const VERSION = "0.8.
|
|
933
|
+
declare const VERSION = "0.8.10";
|
|
934
934
|
|
|
935
935
|
export { AddElementCommand, type ArrowElement, ArrowTool, type ArrowToolOptions, AutoSave, type AutoSaveOptions, Background, type BackgroundOptions, type BackgroundPattern, BatchCommand, type Binding, type Bounds, Camera, type CameraChangeInfo, type CameraOptions, type CanvasElement, type CanvasState, type Command, CreateLayerCommand, ElementRenderer, ElementStore, type ElementType, type ElementUpdateEvent, EraserTool, type EraserToolOptions, EventBus, type ExportImageOptions, type GridElement, HandTool, type HexOrientation, HistoryRecorder, HistoryStack, type HistoryStackOptions, type HtmlElement, type ImageElement, ImageTool, type ImageToolOptions, InputHandler, type Layer, LayerManager, NoteEditor, type NoteElement, NoteTool, type NoteToolOptions, PencilTool, type PencilToolOptions, type Point, type PointerState, Quadtree, RemoveElementCommand, RemoveLayerCommand, type RenderStatsSnapshot, SelectTool, type ShapeElement, type ShapeKind, ShapeTool, type ShapeToolOptions, type Size, type StrokeElement, type StrokePoint, type TextElement, TextTool, type TextToolOptions, type Tool, type ToolContext, ToolManager, type ToolName, UpdateElementCommand, UpdateLayerCommand, VERSION, Viewport, type ViewportOptions, boundsIntersect, clearStaleBindings, createArrow, createGrid, createHtmlElement, createId, createImage, createNote, createShape, createStroke, createText, exportImage, exportState, findBindTarget, findBoundArrows, getArrowBounds, getArrowControlPoint, getArrowMidpoint, getArrowTangentAngle, getBendFromPoint, getEdgeIntersection, getElementBounds, getElementCenter, isBindable, isNearBezier, parseState, snapPoint, unbindArrow, updateBoundArrow };
|
package/dist/index.js
CHANGED
|
@@ -1489,22 +1489,17 @@ function createHexGridTile(cellSize, orientation, strokeColor, strokeWidth, opac
|
|
|
1489
1489
|
tc.stroke();
|
|
1490
1490
|
return { canvas, tileW, tileH };
|
|
1491
1491
|
}
|
|
1492
|
-
function renderHexGridTiled(ctx, bounds, cellSize, tile
|
|
1493
|
-
const
|
|
1494
|
-
|
|
1495
|
-
const
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
bounds.minY - pad,
|
|
1504
|
-
bounds.maxX - bounds.minX + pad * 2,
|
|
1505
|
-
bounds.maxY - bounds.minY + pad * 2
|
|
1506
|
-
);
|
|
1507
|
-
ctx.restore();
|
|
1492
|
+
function renderHexGridTiled(ctx, bounds, cellSize, tile) {
|
|
1493
|
+
const { tileW, tileH } = tile;
|
|
1494
|
+
const startCol = Math.floor(bounds.minX / tileW) - 1;
|
|
1495
|
+
const endCol = Math.ceil(bounds.maxX / tileW) + 1;
|
|
1496
|
+
const startRow = Math.floor(bounds.minY / tileH) - 1;
|
|
1497
|
+
const endRow = Math.ceil(bounds.maxY / tileH) + 1;
|
|
1498
|
+
for (let row = startRow; row <= endRow; row++) {
|
|
1499
|
+
for (let col = startCol; col <= endCol; col++) {
|
|
1500
|
+
ctx.drawImage(tile.canvas, col * tileW, row * tileH, tileW, tileH);
|
|
1501
|
+
}
|
|
1502
|
+
}
|
|
1508
1503
|
}
|
|
1509
1504
|
|
|
1510
1505
|
// src/elements/element-renderer.ts
|
|
@@ -1715,7 +1710,7 @@ var ElementRenderer = class {
|
|
|
1715
1710
|
scale
|
|
1716
1711
|
);
|
|
1717
1712
|
if (tile) {
|
|
1718
|
-
renderHexGridTiled(ctx, bounds, grid.cellSize, tile
|
|
1713
|
+
renderHexGridTiled(ctx, bounds, grid.cellSize, tile);
|
|
1719
1714
|
} else {
|
|
1720
1715
|
renderHexGrid(
|
|
1721
1716
|
ctx,
|
|
@@ -3102,7 +3097,7 @@ var RenderLoop = class {
|
|
|
3102
3097
|
const gridCacheHit = this.gridCacheCanvas !== null && currentZoom === this.gridCacheZoom && currentCamX === this.gridCacheCamX && currentCamY === this.gridCacheCamY && cssWidth === this.gridCacheWidth && cssHeight === this.gridCacheHeight && gridRef === this.lastGridRef;
|
|
3103
3098
|
if (gridCacheHit) {
|
|
3104
3099
|
ctx.save();
|
|
3105
|
-
ctx.setTransform(
|
|
3100
|
+
ctx.setTransform(1, 0, 0, 1, 0, 0);
|
|
3106
3101
|
ctx.drawImage(this.gridCacheCanvas, 0, 0);
|
|
3107
3102
|
ctx.restore();
|
|
3108
3103
|
} else {
|
|
@@ -3119,7 +3114,7 @@ var RenderLoop = class {
|
|
|
3119
3114
|
}
|
|
3120
3115
|
gc.restore();
|
|
3121
3116
|
ctx.save();
|
|
3122
|
-
ctx.setTransform(
|
|
3117
|
+
ctx.setTransform(1, 0, 0, 1, 0, 0);
|
|
3123
3118
|
ctx.drawImage(this.gridCacheCanvas, 0, 0);
|
|
3124
3119
|
ctx.restore();
|
|
3125
3120
|
} else {
|
|
@@ -4838,7 +4833,7 @@ var UpdateLayerCommand = class {
|
|
|
4838
4833
|
};
|
|
4839
4834
|
|
|
4840
4835
|
// src/index.ts
|
|
4841
|
-
var VERSION = "0.8.
|
|
4836
|
+
var VERSION = "0.8.10";
|
|
4842
4837
|
export {
|
|
4843
4838
|
AddElementCommand,
|
|
4844
4839
|
ArrowTool,
|