viliusle / miniPaint

online image editor
http://viliusle.github.io/miniPaint/
Other
2.62k stars 610 forks source link

Pixel Snap Rectangle Tool #209

Closed Giwayume closed 3 years ago

Giwayume commented 3 years ago

I noticed that placing the rectangle tool is kinda shakey, and it often produces light vertical or horizontal borders depending on how exactly your mouse positions it. (at 1x zoom, undesirable for image saving)

image

The problem with the tool is fairly obvious if you zoom into a low resolution image (say 3x3 pixels) and try to use it. It tries to render at non-integer positions and widths.

This PR makes placing a rectangle on the canvas more precise, and viable to use if making pixel perfect adjustments.

Additionally: