Skip to content

Commit

Permalink
Change GridLineColor enum to a const
Browse files Browse the repository at this point in the history
  • Loading branch information
ccanos committed Oct 21, 2024
1 parent 1eca7d5 commit 3bbf15e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ npm link @alkemio/excalidraw --save
Find in json files any `'alkemio-XX'` and set the version you want to publish
```
yarn
cd src/packages/excalidraw
cd packages/excalidraw
yarn install
yarn build:umd
yarn build:esm
yarn pack
yarn publish
```
Expand Down
2 changes: 1 addition & 1 deletion packages/excalidraw/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@alkemio/excalidraw",
"version": "0.17.1-alkemio-5",
"version": "0.17.1-alkemio-7",
"main": "./dist/prod/index.js",
"type": "module",
"module": "./dist/prod/index.js",
Expand Down
12 changes: 6 additions & 6 deletions packages/excalidraw/renderer/staticScene.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ const strokeGrid = (
) => {
const BOLD_LINE_FREQUENCY = 5;

enum GridLineColor {
Bold = "#cccccc",
Regular = "#e5e5e5",
}
const GridLineColor2 = {
Bold: "#cccccc",
Regular: "#e5e5e5",
} as const;

const offsetX =
-Math.round(zoom.value / gridSize) * gridSize + (scrollX % gridSize);
Expand All @@ -65,7 +65,7 @@ const strokeGrid = (
Math.round(x - scrollX) % (BOLD_LINE_FREQUENCY * gridSize) === 0;
context.beginPath();
context.setLineDash(isBold ? [] : lineDash);
context.strokeStyle = isBold ? GridLineColor.Bold : GridLineColor.Regular;
context.strokeStyle = isBold ? GridLineColor2.Bold : GridLineColor2.Regular;
context.moveTo(x, offsetY - gridSize);
context.lineTo(x, offsetY + height + gridSize * 2);
context.stroke();
Expand All @@ -75,7 +75,7 @@ const strokeGrid = (
Math.round(y - scrollY) % (BOLD_LINE_FREQUENCY * gridSize) === 0;
context.beginPath();
context.setLineDash(isBold ? [] : lineDash);
context.strokeStyle = isBold ? GridLineColor.Bold : GridLineColor.Regular;
context.strokeStyle = isBold ? GridLineColor2.Bold : GridLineColor2.Regular;
context.moveTo(offsetX - gridSize, y);
context.lineTo(offsetX + width + gridSize * 2, y);
context.stroke();
Expand Down

0 comments on commit 3bbf15e

Please sign in to comment.