Since the algo has already been done for Snap to Angle (holding Shift) and Snap to Grid it should be feasible to add an option, or modifier (Shift+Alt? but being too hidden = risk of being missed by users, so an option with a visible checkbox would be nice; or a combination of both option and temporary modifier key).
For fun I tried to set the Grip to 1px on X and Y and enable Snap to Grid, and it works: I can now press Shift+S to toggle snapping to grid and therefore perfect lines whenever I want.
However, Snap to Grid causes an unwanted effect:
- when drawing toward the top or left, the first pixel is not confirmed: you need to start the line one grid cell earlier
- when drawing toward the bottom or right, the last pixel is not confirmed: you need to move cursor past the last grid cell before releasing it
Polygon tool doesn’t have this issue but in counter part it tends to “fill” transitional pixels much more as if not following Pencil’s own pixel perfect mode (even though when using Snap to Grid, oddly enough the preview will pretend those extra pixels won’t be drawn, but they are).
These are other issues that I will open GitHub issues for, but that means even my workaround is not that simple to use.
EDIT: for the Polygon, I realised the issue is related to Polygon tool not support non-filled mode (see Draw just the outline of a polygon? - #2 by eishiya). Since it fills, when you draw a single line it will try to “close” the line which will add a few pixels.
EDIT 2: opened an issue for Line missing pixels issue: Snap Grid + draw Line causes first pixel to be missed when drawing toward top/left, last pixel to be missed when drawing toward bottom/right · Issue #4373 · aseprite/aseprite · GitHub