1j01 / jspaint

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

Update tools.js's TOOL_RECTANGLE so that rectangles have sharp edge, working around weirdness in latest Firefox #329

Closed milksteakjellybeans closed 7 months ago

milksteakjellybeans commented 7 months ago

As discussed in https://github.com/1j01/jspaint/issues/326, the drawing of rectangles show a blurred/anti-aliased edge in the recent versions of Firefox. This change restores sharp edges in Firefox. The change is modeled after how the existing code handles the degenerate case of drawing the rectangle (when the rectangle is either not as tall or not as wide as double the rectangle line width), but this version just draws four rectangles, one for each side. There's probably a lot more efficient ways to do this, but this was the simplest fix that fit in with the paradigm that I saw.

1j01 commented 7 months ago

Thank you!