hunkim98 / dotting

Dotting is a pixel art editor component library for react
https://hunkim98.github.io/dotting/
MIT License
43 stars 12 forks source link

Feature: Implement Paint Bucket Mode #12

Closed lerrybe closed 1 year ago

lerrybe commented 1 year ago

🚀 [Issue #3]

Changes

🪣 Paint Bucket (BrushMode)

🍓 Modify DOCS (useBrush story)

Notes

ScreenShot

paint-bucket

hunkim98 commented 1 year ago

Thank you for your contribution🚀! @lerrybe

Your job looks amazing!!!

Your point on changing the brush mode using strategy pattern is worth discussion

I believe we could later change the whole drawing method using such pattern.

For your information, I give you an example of an editor that seems to use strategy pattern for changing its editing method.

[Yorkie Toonie set tool(worker)] https://github.com/yorkie-team/toonie/blob/79f9a7c6033fceb5d23bb335d35bf8e66ec8361f/src/components/Editor/DrawingBoard/Canvas/Board.ts#L275-L305

[Yorke Toonie list of workers] https://github.com/yorkie-team/toonie/tree/79f9a7c6033fceb5d23bb335d35bf8e66ec8361f/src/components/Editor/DrawingBoard/Canvas/Worker

The above examples are what I wrote last year in Naver (By the way, the code is quite similar to dotting)

If I find other better example, I will update you.

lerrybe commented 1 year ago

I modified reflecting reviews. Thank you for your helpful references and reviews! 🤩 @hunkim98