Skip to content

Commit

Permalink
Merge pull request #106 from melfore/develop
Browse files Browse the repository at this point in the history
[Task] Fixed default hex color string
  • Loading branch information
luciob authored Sep 26, 2023
2 parents 50f42c5 + 4f3e527 commit af25317
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 19 deletions.
16 changes: 0 additions & 16 deletions .vscode/konva-timeline-scripts.code-snippets
Original file line number Diff line number Diff line change
@@ -1,20 +1,4 @@
{
// Place your iitops-ic-awacs-acc-web workspace snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
// Placeholders with the same ids are connected.
// Example:
// "Print to console": {
// "scope": "javascript,typescript",
// "prefix": "log",
// "body": [
// "console.log('$1');",
// "$2"
// ],
// "description": "Log output to console"
// }
"TSReact Component": {
"prefix": "tsreact-component",
"description": "Create a new TSReact component",
Expand Down
4 changes: 3 additions & 1 deletion src/tasks/components/Layer/index.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,7 @@ export default meta;
type Story = StoryObj<typeof meta>;

export const Primary: Story = {
args: {},
args: {
taskTooltip: null,
},
};
7 changes: 5 additions & 2 deletions src/tasks/components/Task/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ type TaskProps = KonvaDrawable &
width: number;
};

const TASK_DEFAULT_FILL = "transparent";
const TASK_DEFAULT_STROKE = "black";
const TASK_DEFAULT_FILL = "#FFFFFF";
const TASK_DEFAULT_STROKE = "#000000";

const TASK_BORDER_RADIUS = 4;

Expand Down Expand Up @@ -132,9 +132,12 @@ const Task = ({ data, fill = TASK_DEFAULT_FILL, onLeave, onOver, x, y, width }:
const onDragMove = useCallback(
(e: KonvaEventObject<DragEvent>) => {
const { x, y } = getDragPoint(e);
// console.log("=> onDragMove.dragY", y);
const resourceIndex = findResourceIndexByCoordinate(y, rowHeight, resources);
// console.log("=> onDragMove.resourceIndex", resourceIndex);
const dragFinalX = Math.ceil(x / dragSnapInPX) * dragSnapInPX;
const point = getBoundedCoordinates(dragFinalX, resourceIndex);
// console.log("=> onDragMove.point.y", point.y);
e.target.setPosition(point);
onOver(taskId, point);
},
Expand Down

0 comments on commit af25317

Please sign in to comment.