ApoorvaJ / Papaya

A GPU-powered image editor (in the making)
MIT License
374 stars 33 forks source link

Shift+Brushing for straight lines #10

Closed ApoorvaJ closed 8 years ago

ApoorvaJ commented 8 years ago

Vertical/horizontal lines by shift-dragging Pressing shift and then dragging the brush should create straight lines. We should automatically detect whether the user is trying to make a horizontal line, or a vertical one, and draw the line accordingly.

Arbitrary straight lines by shift-clicking Brush click, and then shift+brush click on another point should draw a straight line between the previous click location and the current one. Continuing to do this while pressing shift should allow the user to draw a path of connected line segments.

The code for the above two fixes should be located in src/papaya_core.cpp in the UpdateAndRender() function in the scope titled // Brush tool.

Undo integration Undo integration will be really useful here. If the user draws an arbitrary straight line by clicking on a point A, then shift-clicking on point B, then undoing, and then shift-clicking on point C, it would be handy to draw line AC instead of line BC. I will handle this undo integration myself, if someone submits the above enhancement.

ApoorvaJ commented 8 years ago

animation3

Thanks GreenLightning for the awesome feature. I used it to make some quick art. :)

Closing the issue.