Trochoids: Better drag-less shapes
If the user just clicks & releases, the shapes that appear are more interesting/pleasing.
This commit is contained in:
parent
ec678debe5
commit
2d043eb33d
2 changed files with 19 additions and 11 deletions
|
|
@ -6,7 +6,7 @@ Copyright (c) 2002-2024
|
|||
Various contributors (see below, and AUTHORS.txt)
|
||||
https://tuxpaint.org/
|
||||
|
||||
2024.January.21 (0.9.32)
|
||||
2024.January.26 (0.9.32)
|
||||
* Improvements to Magic tools:
|
||||
----------------------------
|
||||
* Magic tool plugin API updates
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
by Bill Kendrick <bill@newbreedsoftware.com>
|
||||
with help from Pere Pujal Carabantes
|
||||
|
||||
January 6, 2024 - January 17, 2024
|
||||
January 6, 2024 - January 26, 2024
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
|
@ -508,15 +508,6 @@ void trochoids_release(magic_api * api, int which,
|
|||
otherwise it will seem like the sound only happens intermittently) */
|
||||
api->stopsound();
|
||||
|
||||
/* If they clicked & released with no drag,
|
||||
ignore the (x,y) we received; we want the
|
||||
'default' offset to get a reasonably pleasant
|
||||
shape -- for users who tried clicking w/o dragging */
|
||||
if (dragged == 0) {
|
||||
x += (canvas->w / 20);
|
||||
y += (canvas->h / 20);
|
||||
}
|
||||
|
||||
/* Pick which sound to play & play it */
|
||||
tool = which_to_tool[which];
|
||||
if (tool == TOOL_EPITROCHOID_SIZES ||
|
||||
|
|
@ -530,6 +521,23 @@ void trochoids_release(magic_api * api, int which,
|
|||
trochoids_sound(api, snd_idx, x, y);
|
||||
|
||||
|
||||
/* If they clicked & released with no drag,
|
||||
ignore the (x,y) we received; we want the
|
||||
'default' offset to get a reasonably pleasant
|
||||
shape -- for users who tried clicking w/o dragging */
|
||||
if (dragged == 0) {
|
||||
if (tool == TOOL_EPITROCHOID_SIZES ||
|
||||
tool == TOOL_EPITROCHOID_NOSIZES_1 ||
|
||||
tool == TOOL_EPITROCHOID_NOSIZES_2 ||
|
||||
tool == TOOL_EPITROCHOID_NOSIZES_3) {
|
||||
x = trochoids_x + 50;
|
||||
y = trochoids_y + 20;
|
||||
} else {
|
||||
x = trochoids_x + 70;
|
||||
y = trochoids_y + 30;
|
||||
}
|
||||
}
|
||||
|
||||
/* Draw it (no guides, this time!) */
|
||||
trochoids_work(api, which, canvas, snapshot, x, y, update_rect, 0);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue