1j01 / jspaint

🎨 Classic MS Paint, REVIVED + ✨Extras
https://jspaint.app/about
MIT License
7.17k stars 562 forks source link

[Feature] Treat pattern-filled areas like solid color #266

Closed lafoxxx92 closed 2 years ago

lafoxxx92 commented 2 years ago

Steps:

  1. Change theme to New Year
  2. Select Pattern color (one of the right ones)
  3. Draw some lines/fill some areas
  4. Change color
  5. Attempt to Fill the Patterned area with the new color

Actual: Only adjacent pixels of same color are Filled with new color

Expected: All Patterned area within specific boundaries (image/shape of other color) is affected by Fill tool, not just some lines of same color.

Implementation suggestions (not sure how it works, might be not relevant): Use some special (invisible) color to render the Pattern over it, treat this special (invisible) color like the regular color when editing.

1j01 commented 2 years ago

This isn't how MS Paint works, with patterns in Black and White mode, and I don't plan on implementing it. It's complicated, although you suggest a reasonable way to do it, but there are merits to it working either way. Replacing a pattern may be intuitive, but it's also nice to have it simple and consistent, with no hidden semantics of a pixel belonging to a pattern or not.

Consider what happens when you save. Either:

  1. It would save as a special color like you describe, and not show up as a pattern, or
  2. It would show up as a pattern but when you load it back into the app it works differently, where you can no longer replace a pattern with a new color.
  3. Or a new format could be introduced that would store this information, but still loading a "plain" image would be inconsistent with loading this new format.