From b8c021cf57d30a959a56804e5c7b7981bb67f31e Mon Sep 17 00:00:00 2001 From: luciob Date: Mon, 18 Sep 2023 15:04:59 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20[Grid]=20Display=205%=20?= =?UTF-8?q?grid=20before=20/=20after?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/@components/Timeline/index.tsx | 2 +- src/{@components/GridLayer => grid/Layer}/index.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) rename src/{@components/GridLayer => grid/Layer}/index.tsx (96%) diff --git a/src/@components/Timeline/index.tsx b/src/@components/Timeline/index.tsx index dd98383..bb12ab3 100644 --- a/src/@components/Timeline/index.tsx +++ b/src/@components/Timeline/index.tsx @@ -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"; diff --git a/src/@components/GridLayer/index.tsx b/src/grid/Layer/index.tsx similarity index 96% rename from src/@components/GridLayer/index.tsx rename to src/grid/Layer/index.tsx index 605073f..82773b9 100644 --- a/src/@components/GridLayer/index.tsx +++ b/src/grid/Layer/index.tsx @@ -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; @@ -82,7 +82,7 @@ const GridLayer: FC = ({ columnWidth, height, width }) => { {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; }