Skip to content

Conversation

@bhavjsh
Copy link
Contributor

@bhavjsh bhavjsh commented Jan 18, 2026

Problem

Hexagon (polygon) drawing required point-by-point taps, unlike other shapes
(circle, rectangle) which support click-and-drag drawing.

Solution

Updated paint canvas gesture handling so hexagon follows the same
click-and-drag behavior as other shape tools.

Result

  • Consistent UX across all shape tools
  • Hexagon now draws smoothly via drag gesture

Demo

Screen recording showing hexagon drag behavior:

Screen.Recording.2026-01-19.000455.mp4

@hm21
Copy link
Owner

hm21 commented Jan 19, 2026

Thanks for creating that PR.

The issue is that we're actually working with polygons, which have a minimum of 3 sides and are meant to be dynamic based on the user input. In your code, I see you've added a Hexagon, which has exactly 6 sides. Unfortunately, I can't merge the PR since that would prevent users from drawing dynamic polygons, which was actually a previous feature request.

However, would it be helpful for you to support specific shapes like Hexagon, Pentagon, Heptagon, etc.? If so, technically you just need to create a new path_builder, similar to how it's done for the circle. Let me know if you're interested in doing that and I can explain it in more detail and help implement that.

Just a quick note (not a criticism, more of a suggestion): I assume the code was "Vibe-Coded" which is completly fine, but I’d appreciate it if commits only included changes relevant to the improvement. For example, a lot existing doc comments were removed and random comments like ✅ NOT const were added. During review, that creates a lot of noise and extra review commits to undo unrelated changes. Renaming things like widget.paintCtrl to _paintCtrl is totally fine, though. I’d just prefer style or doc updates to be in a separate PR. Again, not a complaint, just a tip to help make the review process smoother.

Thanks again for raising that PR, your idea to add hexagons like that is really cool :)

@hm21 hm21 closed this Jan 19, 2026
@bhavjsh
Copy link
Contributor Author

bhavjsh commented Jan 19, 2026

You're right overloading the polygon tool with a fixed 6-sided shape isn't ideal.
I like the idea of supporting explicit shapes (hexagon, pentagon, etc.) via a dedicated path_builder similar to circle.

I’d be very interested in implementing this properly following the existing architecture.
If you could point me to the relevant path_builder or files to extend, I’d be happy to work on a new PR with a cleaner, focused change.

Also noted the feedback about keeping PRs scoped , will keep improvements isolated going forward.
Thanks for the guidance!

@hm21
Copy link
Owner

hm21 commented Jan 19, 2026

Awesome! I'd love to hear that you want to implement it. As a quick guide:

  1. Add a new path_builder to the this folder. For example path_builder_hexagon.dart
  2. Add every new path you created here.
  3. Create a new "PaintMode" here.
  4. Add a new translation for that mode here.
  5. Add a new icon here.
  6. Add the new content here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants