Skip to content

Commit

Permalink
Combined both elements of the handle
Browse files Browse the repository at this point in the history
  • Loading branch information
guzmanvig committed Feb 26, 2024
1 parent 958bfdd commit 07e2514
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions src/Linear/Translations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -351,19 +351,15 @@ const SingleNamedElementHandle = (props: {
const marginTop = 2;

let linePath = "";
// First rectangle that contains the name and has the whole height
linePath += `M 0 ${marginTop}
L ${nameHandleWidth} ${marginTop}
L ${nameHandleWidth} ${height - marginBottom}
L 0 ${height - marginBottom}
Z`;

// Second rectangle with half the height and centered (minus half the margin at the bottom and half on top)
linePath += `M ${nameHandleWidth} ${height / 4 - marginBottom / 2 + marginTop / 2}
L ${w} ${height / 4 - marginBottom / 2 + marginTop / 2}
L ${w} ${(3 * height) / 4 - marginBottom / 2 + marginTop / 2}
L ${nameHandleWidth} ${(3 * height) / 4 - marginBottom / 2 + marginTop / 2}
Z`;
L ${nameHandleWidth} ${marginTop}
L ${nameHandleWidth} ${height / 4 - marginBottom / 2 + marginTop / 2}
L ${w} ${height / 4 - marginBottom / 2 + marginTop / 2}
L ${w} ${(3 * height) / 4 - marginBottom / 2 + marginTop / 2}
L ${nameHandleWidth} ${(3 * height) / 4 - marginBottom / 2 + marginTop / 2}
L ${nameHandleWidth} ${height - marginBottom}
L 0 ${height - marginBottom}
Z`;

return (
<g
Expand Down

0 comments on commit 07e2514

Please sign in to comment.