Browse Source

graph: text nodes are rectangles

mj-deploy
Vašek Šraier 4 years ago
parent
commit
e383d513f8
  1. 6
      frontend/src/GraphNode.svelte

6
frontend/src/GraphNode.svelte

@ -83,7 +83,7 @@
fill: green; /* TODO */ fill: green; /* TODO */
} }
.selected > ellipse { .selected > ellipse, .selected > rect {
stroke-width: 4px; stroke-width: 4px;
stroke: red; stroke: red;
} }
@ -110,8 +110,12 @@
transform="translate({cx}, {cy}) rotate({task.rotationAngle ?? 0}) translate({-cx}, {-cy})"> transform="translate({cx}, {cy}) rotate({task.rotationAngle ?? 0}) translate({-cx}, {-cy})">
{task.title == null ? task.id : task.title} {task.title == null ? task.id : task.title}
</text> </text>
{:else}
{#if task.type == "text"}
<rect class="taskNode" x={cx-ellipse_rx} y={cy-20} height={40} width={2*ellipse_rx} rx={3} />
{:else} {:else}
<ellipse class="taskNode" rx={ellipse_rx} ry={20} {cx} {cy} /> <ellipse class="taskNode" rx={ellipse_rx} ry={20} {cx} {cy} />
{/if}
<text <text
bind:this={text_element} bind:this={text_element}
x={cx} x={cx}