Skip to content

Commit

Permalink
feat: 🎸 [Grid] Display 5% grid before / after
Browse files Browse the repository at this point in the history
  • Loading branch information
luciob committed Sep 18, 2023
1 parent 919d87b commit b8c021c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/@components/Timeline/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Konva from "konva";
import { useTimelineContext } from "../../@contexts/Timeline";
import { logDebug } from "../../@utils/logger";
import { RESOURCE_HEADER_WIDTH } from "../../@utils/resources";
import GridLayer from "../GridLayer";
import GridLayer from "../../grid/Layer";
import ResourcesLayer from "../ResourcesLayer";
import TasksLayer from "../TasksLayer";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { FC, useCallback, useMemo } from "react";

import { KonvaGroup, KonvaLayer, KonvaLine, KonvaRect, KonvaText } from "../../@components/@konva";
import { useTimelineContext } from "../../@contexts/Timeline";
import { displayInterval } from "../../@utils/time-resolution";
import { KonvaGroup, KonvaLayer, KonvaLine, KonvaRect, KonvaText } from "../@konva";

interface GridLayerProps {
columnWidth: number;
Expand Down Expand Up @@ -82,7 +82,7 @@ const GridLayer: FC<GridLayerProps> = ({ columnWidth, height, width }) => {
<KonvaLine points={[0, 0, 0, height]} stroke="blue" />
{timeBlocks.map((column, index) => {
const xPos = columnWidth * index;
if (xPos < drawRange.start * -2 || xPos > drawRange.end * 2) {
if (xPos < drawRange.start * -1.05 || xPos > drawRange.end * 1.05) {
return null;
}

Expand Down

0 comments on commit b8c021c

Please sign in to comment.