Repository navigation
feat: cylinder (database) shape tool - #116
Merged
Merged
Conversation
Add a database-cylinder primitive: toolbar button, drag-to-size draw, and full style support. It's a plain fabric.Path so it styles (stroke/fill/width/dash) and binds like any other shape — arrows attach to its border and follow it. The rim arcs bulge to the box edges but fabric's arc bbox misses the bottom bulge, so width/height/pathOffset are set to the true box (selection + binding match what's drawn). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Deploying whiteboard with
|
| Latest commit: |
2982288
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://a872137a.whiteboard-988.pages.dev |
| Branch Preview URL: | https://feat-cylinder-shape.whiteboard-988.pages.dev |
The arc-based path had wrong sweep directions so a filled cylinder pinched at the sides and left the bottom crescent unfilled (only showed with a fill — the first pass was tested transparent). Rebuild the rims from cubic beziers: straight sides, back top rim (up), front bottom rim (down); fill covers the whole body incl. the top ellipse band, with the front lid rim stroked on top. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Adds a database cylinder primitive — the first P0 building block for the AI-diagram track, and useful on its own.
Cylinder, between Polygon and Line).fabric.Path, so it styles (stroke / fill / width / dash) and binds like any shape — arrows attach to its border and stay glued when it moves.Wired through the same points every shape uses:
tools/cylinder.js,tools/index.js,assignUtil.js,constants/tools.js,constants/IconTools.js, andSTYLEABLE_TOOLSin the panel.One implementation note
The cylinder's rim arcs bulge to the box edges, but fabric's arc bounding-box misses the bottom bulge (reports height short). Since the geometry spans exactly the drag box,
width/height/pathOffsetare set explicitly so selection and binding match what's drawn.Test plan
cylinder.test.js: drag-to-size dimensions, up/left drag, click-to-default, andisBindable. 89 tests pass; lint + prettier clean.🤖 Generated with Claude Code