Fill -> Linear Gradient: Show angle while dragging

When using the Linear Gradient fill tool, the angle of the
gradient is now is shown (in the instructions at the bottom).

h/t Miyagi Andel for the idea
This commit is contained in:
Bill Kendrick 2023-07-01 01:21:10 -07:00
parent 89a164df3d
commit e98daa5a62
4 changed files with 26 additions and 4 deletions

View file

@ -6,7 +6,7 @@ Copyright (c) 2002-2023
Various contributors (see below, and AUTHORS.txt) Various contributors (see below, and AUTHORS.txt)
https://tuxpaint.org/ https://tuxpaint.org/
2023.June.29 (0.9.31) 2023.July.1 (0.9.31)
* New Magic Tools: * New Magic Tools:
---------------- ----------------
* Loops - Draw loop-the-loops. * Loops - Draw loop-the-loops.
@ -35,6 +35,13 @@ https://tuxpaint.org/
* Fuzzy round erasers * Fuzzy round erasers
Bill Kendrick <bill@newbreedsoftware.com> Bill Kendrick <bill@newbreedsoftware.com>
* Improvements to Fill tool:
--------------------------
* When using the Linear Gradient fill tool, the angle of the
gradient is now is shown (in the instructions at the bottom).
Bill Kendrick <bill@newbreedsoftware.com>
h/t Miyagi Andel for the idea
* Other Improvements: * Other Improvements:
------------------- -------------------
* Saved pictures can, from the Open dialog, be copied into * Saved pictures can, from the Open dialog, be copied into

View file

@ -27,7 +27,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
(See COPYING.txt) (See COPYING.txt)
Last updated: March 7, 2023 Last updated: July 1, 2023
$Id$ $Id$
*/ */
@ -72,4 +72,6 @@ const char *const fill_img_fnames[NUM_FILLS] = {
DATA_PREFIX "images/fills/gradient_shaped.png" DATA_PREFIX "images/fills/gradient_shaped.png"
}; };
#define TIP_FILL_LINEAR_MOVING gettext_noop("Click and drag to fill an area with a linear gradient (from the chosen color to transparent). (Your gradients angle is %.0f degrees.)")
#endif #endif

View file

@ -19,7 +19,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
(See COPYING.txt) (See COPYING.txt)
Copyright (c) 2002-2022 by Bill Kendrick Copyright (c) 2002-2023 by Bill Kendrick
bill@newbreedsoftware.com bill@newbreedsoftware.com
https://tuxpaint.org/ https://tuxpaint.org/

View file

@ -22,7 +22,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
(See COPYING.txt) (See COPYING.txt)
June 14, 2002 - June 21, 2023 June 14, 2002 - July 2, 2023
*/ */
#include "platform.h" #include "platform.h"
@ -6652,6 +6652,19 @@ static void mainloop(void)
new_x, new_y, draw_color, sim_flood_touched); new_x, new_y, draw_color, sim_flood_touched);
update_canvas(sim_flood_x1, sim_flood_y1, sim_flood_x2, sim_flood_y2); update_canvas(sim_flood_x1, sim_flood_y1, sim_flood_x2, sim_flood_y2);
if (new_y != fill_y)
angle = (atan2f((new_x - fill_x), (new_y - fill_y)) * 180 / M_PI) - 90.0;
else if (new_x >= fill_x)
angle = 0.0;
else
angle = 180.0;
if (angle < 0.0)
angle += 360.0;
snprintf(angle_tool_text, sizeof(angle_tool_text), gettext(TIP_FILL_LINEAR_MOVING), floor(angle));
draw_tux_text(TUX_GREAT, angle_tool_text, 1);
} }
else if (cur_tool == TOOL_FILL && cur_fill == FILL_BRUSH) else if (cur_tool == TOOL_FILL && cur_fill == FILL_BRUSH)
{ {