Commit graph

19 commits

Author SHA1 Message Date
Bill Kendrick
e80254df51 Ran indent.sh to re-indent all source code 2025-03-24 19:33:13 -07:00
Bill Kendrick
44d7d0ee5d Re-run indent.sh under GNU indent 2.2.13
Slight change to its default behavior re: pointer variables
(before: "type * var"; now seems to prefer: "type *var").
2024-10-20 11:22:30 -07:00
Bill Kendrick
2183c45d72 Filled Polygon: Ensure last point can click on first point
It had to be dragged, due to a minor bug.  h/t Pere.
2024-06-01 20:35:13 -07:00
Bill Kendrick
b9981d879b Filled Polygon Magic - allow up to 100 points
Up from 17 (which I probably picked since it was a little
fewer than the default number of Undo/Redo levels).
2024-06-01 20:27:30 -07:00
Bill Kendrick
3cf3af76aa Ran indent.sh 2024-06-01 02:12:00 -07:00
Bill Kendrick
01afb5846c api->retract_undo() added to Magic API; used by Filled Polygon
New API function which rolls back the Undo buffer (which is snapshotted
upon a mousedown event ahead of calling the Magic tool's `_click()`
function.)  Dangerous; use sparingly!

Filled Polygon uses this to prevent partially-created (aka unfinished
aka incomplete) polygons -- the preview lines and control points -- from
being recorded and wasting space in the Undo history, or reappearing
upon Redo.

TODO - Other tools (e.g., Clone) would certainly benefit from this.
TODO - Needs more testing to help identify any bugs/issues introduced
by this!
TODO - Magic API docs need updating.

This is probably a sufficient solution that will make
https://sourceforge.net/p/tuxpaint/feature-requests/246/,
'"Overlay" surface in Magic API', unnecessary.
2024-06-01 01:35:50 -07:00
Bill Kendrick
b0b3b64022 Filled Polygon: Mention merging. Max pt handling.
In instructions, mention that adjacent points may be merged.

When no more space is available for additional points, simply
move the last point to the new location (rather than silently
doing nothing).

h/t Pere for the ideas
2024-05-30 23:50:00 -07:00
Bill Kendrick
277b9e10bf Filled Polygon "remove" sound effect
For when merging points.

Based on CC Attribution 3.0 sound by "stinkhorn"
(see CHANGES.txt & AUTHORS.txt).
2024-05-28 23:59:56 -07:00
Bill Kendrick
c00cf991f9 Filled Polygon "nearby" sound effect
When red & green endpoint dots are being dragged near each other,
play a different sound.

Based on CC Attribution 4.0 sound by Eliot Lash
(see CHANGES.txt & AUTHORS.txt).
2024-05-28 23:47:54 -07:00
Bill Kendrick
a2fece280b Sound effects for Filled Polygon magic tool
Based on some CC0 sounds by Kenneth Cooney (see AUTHORS.txt and
CHANGES.txt).
2024-05-28 23:29:57 -07:00
Bill Kendrick
4c42472089 Polyfill: Draw handles 'behind' lines 2024-05-19 23:56:20 -07:00
Bill Kendrick
4a79060f26 Ran indent 2024-05-14 23:37:12 -07:00
Bill Kendrick
d26b4f28ff Polyfill - Address compiler warnings, other cleanup 2024-05-14 23:09:18 -07:00
Bill Kendrick
5bdbc2766b Ran indent.sh to re-indent all source files 2024-05-10 00:26:10 -07:00
Bill Kendrick
ae899da68d Filled polygon: Icon; tweaked on-screen instructions 2024-04-12 09:24:19 -07:00
Bill Kendrick
5139985781 Polygon fill: Be a better citizen
Remove our preview if switching out of the tool.
Do not wipe out previous work when switching into the tool
(it seems Tux Paint calls "set_color()" _before_ "switchin()"!?)
2024-04-08 20:55:27 -07:00
Bill Kendrick
ead268de51 Polyfill - Allow clicking first point to end polygon
...clicking, followed by dragging prior to releasing,
still works to move the first (green) point.
2024-03-28 00:50:27 -07:00
Bill Kendrick
da837a35a2 Polyfill filling polygons now
Scanline polygon fill routine based on public-domain code
by Darel Rex Finley, 2007 <https://alienryderflex.com/polygon_fill/
2024-03-28 00:26:05 -07:00
Bill Kendrick
608564b00f WIP Filled Polygon Magic tool
Currently able to add & adjust points, which forms a polygon.
It is not filled yet.
2024-03-27 23:41:41 -07:00