Commit graph

1420 commits

Author SHA1 Message Date
Bill Kendrick
269355a99c Ensure {datadir}/templates exists when making template
Example

  mkdir /tmp/tp
  tuxpaint --datadir /tmp/tp

without this fix, choosing "Template" (make a new templat)
from "Open" dialog would result in an error, since
`/tmp/tp/templates` did not exist.

We now `mkdir()` it.  This requires, of course, that the
directory specified by `--datadir` _itself_ exists.  (We will
not attempt to create anything higher up.)
2023-05-27 12:07:47 -07:00
Bill Kendrick
10092ece0e Starter/Template thumbnails: use DIR_DATA, not DIR_SAVE
Places where we attempt to save thumbnails of starters & templates
was trying to `mkdir()` a `.thumbs/` subdirectory in non-existent
`starters/` and `templates/` subdirectories of the "savedir"
location; should be the "datadir" one.

To replicate

  mkdir -p /tmp/tp/starters
  cp SOMEFILE.png /tmp/tp/starters
  tuxpaint --datadir /tmp/tp

then click "New"; observer the warning

  Error: Couldn't save thumbnail of saved image!
  /tmp/tp/starters/.thumbs/SOMEFILE.png
  The error that occurred was:
  No such file or directory
2023-05-27 11:55:55 -07:00
Bill Kendrick
7b6f04ac1d Problem loading templates from overridden 'datadir'
When specifying "datadir", Tux Paint's "New" dialog
was able to present templates found in that directory,
but would attempt to load from whatever the user's
"savedir" was, instead.

h/t Giancarlo Orru for reporting the bug.
2023-05-27 11:51:03 -07:00
Bill Kendrick
955c39c053 WIP Ability to copy saved drawing into a new template
https://sourceforge.net/p/tuxpaint/feature-requests/236/
2023-05-25 23:20:32 -07:00
Bill Kendrick
313555f6a1 Wrapped up initial stab at fuzzy erasers 2023-05-22 23:02:31 -07:00
Bill Kendrick
065060de03 More work on fuzzy eraser; better behavior w/ Ctrl-Z & -R 2023-05-22 22:24:47 -07:00
Bill Kendrick
d31bc814e6 WIP - Fuzzy erasers
Also, mend scroll button / interaction bug in Eraser selector.
2023-05-22 00:33:52 -07:00
Bill Kendrick
2d99a823f2 fix location for tuxpaint.cfg on Haiku
Unclear why when I `git pull` in master, I'm not seeing
https://sourceforge.net/p/tuxpaint/tuxpaint/ci/b48cb438239e47ebce3c6b84f5aff2d7d906d3ba/
so just replicating it (plus adding entry to docs/CHANGES.txt).
2023-05-12 00:19:22 -07:00
Bill Kendrick
8e9a51d478 Define & use NUM_ERASER_SIZES
...everywhere "NUM_ERASERS / 2" was being used
2023-05-10 23:20:05 -07:00
Bill Kendrick
a58f1f64b5 pick_best_scape() is now always included (even when building with NOSVG)
Was failing to compile on Haiku for Luc (apparently building with
no SVG support), since I started using that function outside of
SVG-related places.

Also, to continue being able to compile on Linux with no SVG support --
 * Always use SDL_TRUE & SDL_FALSE, not TRUE & FALSE
 * Always link tuxpaint with "-lm"

Finally, verbose version info ("tuxpaint --verbose-version") now states which
SVG build (new RSVG or old Cairo)
2023-05-09 23:44:39 -07:00
Bill Kendrick
3ae4517a08 Mend compiler warning (don't cast ceil() to (int)) 2023-05-04 23:36:04 -07:00
Bill Kendrick
3f5bc2b554 thumbnail2() - ceil() the new_x & new_y calculations
I noticed that buttonsize=90 or =91 would end up with UI buttons
images ere one pixel smaller (89x89 or 90x90, respectively) than
expected, hence they layout would end up with one row and one
column of unused pixels between them.  Any button content (e.g.
stamp thumbnails) that might render into the full size would end
up leaving garbage pixels behind.

Applying ceil() to the new_x and new_y (but then making sure they do
not exceed the requested max_x and max_y) calculated sizes inside the
thumbnail2() function.  (We do not simply use max_x and max_y directly,
because we are usually trying to maintain the original image's aspect
ratio.)
2023-05-04 23:29:39 -07:00
Bill Kendrick
aa2235c8ba Reduce max button size; account for new stamp control row
...for rotation button added in 0.9.29
2023-05-04 22:43:59 -07:00
Pere Pujal i Carabantes
3743a15673 printf -> DEBUG_PRINTF Shapes tool output filled my terminal. 2023-05-03 20:41:34 +02:00
Bill Kendrick
de7b8dd51b After Ctrl+click pipette, color selector showed old color
Was redrawing color toolbar _before_ changing the chosen color
to be the pipette tool.

Reproducing the bug - Select a built-in color, Ctrl+click in the canvas,
observe built-in color still appears chosen [the bug], paint with e.g.,
paint brush, observe it's using the correct, pipette-selected color,
not the one that appears chosen [this is correct].
2023-05-03 10:11:56 -07:00
Bill Kendrick
ef5d6ae751 Remove dangling func prototype
... anti_carriage_return() no longer exists, now that we don't
need it since we always require SDL2_Pango
2023-05-01 14:00:05 -07:00
Bill Kendrick
cef773a694 Now REQUIRING SDL2_Pango; no NO_SDLPANGO option
Motivation - Without SDL2_Pango, languages like Japanese,
Arabic, and Thai do not render properly.  Currently, Debian
(and hence Ubuntu) do not have SDL2_Pango, so Tux Paint 0.9.28
is adversely affected.  Fedora DOES have SDL2_Pango, so works well.
This also allows us to delete a lot of ancient cruft code.

Closes https://sourceforge.net/p/tuxpaint/bugs/268/
h/t Pere

(INSTALL docs to be updated momentarily)
2023-04-30 16:10:29 -07:00
Bill Kendrick
378b2acca6 Accept SDL_VIDEO_WINDOW_POS in --fullscreen too
This seems to allow me to specify which display (monitor) to make
Tux Paint appear on my two-monitor set-up (laptop + external monitor)!

Closes https://sourceforge.net/p/tuxpaint/bugs/277/
2023-04-28 00:13:32 -07:00
Bill Kendrick
98b22a7296 Call Magic tool's set_size() on mode switch
Some tools would get stuck unable to draw in MODE_PAINT mode,
when switching from MODE_FULLSCREEN.
2023-04-27 23:44:44 -07:00
Bill Kendrick
18f9cad6fe Adding "indent.sh" to re-indent code; ran it!!! 2023-04-23 23:26:00 -07:00
Bill Kendrick
06a36c571e Clone: Support sizes; performance boost 2023-04-20 22:15:01 -07:00
Bill Kendrick
9b80c0d688 Don't load blank-named template during slideshow 2023-04-19 21:56:46 -07:00
Bill Kendrick
b2535d59ba Magic size capabilites on a per-mode basis
e.g., useful to set size for paint-mode blur, but meaningless
for fullscreen-mode blur.
2023-04-12 23:39:55 -07:00
Bill Kendrick
5bbfd91c2c Magic size controls work!
However, need to make their availability set-able on a per-mode
basis.
2023-04-12 23:09:37 -07:00
Bill Kendrick
3996edaeec Magic: Show a size selector
...still doesn't interact yet, but it renders!
2023-04-12 22:49:09 -07:00
Bill Kendrick
263b382338 Preparing a space for Magic size control
Magic Controls (paint vs fullscreen) and Sizes (coming soon)
can be enabled/disabled independently, and the list of Magic tools
sizes itself accordingly.
2023-04-12 22:31:05 -07:00
Bill Kendrick
eda0a646be Parse support for [no]magicsizes; new MAGIC_FEATURE_CONTROL bitmask 2023-04-12 00:11:11 -07:00
Bill Kendrick
c2585d7a26 Doc'ing forthcoming [no]magicsizes options 2023-04-12 00:03:23 -07:00
Bill Kendrick
bb12be2518 More work on Magic size support
Set default, pass current size to plugin when tool changes.
2023-04-11 23:57:51 -07:00
Bill Kendrick
7bdb19ff0f More work on Magic size support; "kalidescope" <sic> is underway 2023-04-11 22:16:45 -07:00
Bill Kendrick
1b420da45c Slightly more verbose output from "--verbose-version"
Shows when certain features are enabled; not just disabled.
2023-04-11 00:55:42 -07:00
Bill Kendrick
f7dfb95570 Scale button icons when label text is word-wrapped
For https://sourceforge.net/p/tuxpaint/bugs/131/
2023-04-11 00:26:20 -07:00
Bill Kendrick
81d7b0026d WIP Word-wrap long button labels
For https://sourceforge.net/p/tuxpaint/bugs/131/
2023-04-11 00:06:45 -07:00
Bill Kendrick
9dd95721d5 Stamps: Don't play English descr. when not in 'en' locale
Avoid playing English descriptive sound for a stamp
stamp when not running in an English locale.
Closes https://sourceforge.net/p/tuxpaint/bugs/261/
2023-04-09 23:07:29 -07:00
Bill Kendrick
9085328eb2 Mend stars breakage; clean up shapes.h 2023-04-09 22:52:25 -07:00
Bill Kendrick
58bb30bafc Shape tool calculations: use floats more 2023-04-09 22:27:04 -07:00
Pere Pujal i Carabantes
3b0eea5118 Make stamp outlines be displayed on touchscreens. 2023-03-25 00:16:02 +01:00
Bill Kendrick
c19f5b1d4c Thicker XOR outline around stamps 2023-03-21 23:10:08 -07:00
Bill Kendrick
98cb1e62e7 Prevent pipette dismissal upon release over 'Back'
On touch devices, the color pipette tool could easilly be
immediately dismissed due to the 'button up' event happening
right where the "Back" dismissal/cancel button appeared.
Now only pays attention to 'release' if the button was down.

(h/t Pere for reporting this)
2023-03-21 22:57:59 -07:00
Bill Kendrick
df65409671 Mend aspect ratio bug in thumbnail function
SVG-based Stamp images which were not square would get stretched and
look weird in the selector on the right.
2023-03-19 11:15:48 -07:00
Bill Kendrick
3ae57adf9d No 'true' 2023-03-15 21:34:08 -07:00
Bill Kendrick
b2ac965328 Bump date in tuxpaint.c & CHANGES.txt 2023-03-15 21:24:08 -07:00
Mark Kim
f95aea5bbc Dialog popup animation refinement
Also, ensure the top and left borders are drawn.
2023-03-15 22:26:48 -04:00
Mark Kim
bf26a45f6c Re-enable SDL timer full time
Enabling the SDL timer selectively was required on macOS in SDL1 for
performance reasons, but it is no longer needed on SDL2.
2023-03-15 21:37:30 -04:00
Bill Kendrick
e77e9b89d4 Tweak to prompt pop-up updated
On my laptop the prompt was basically not coming up at all
(only one animation step every few seconds), because apparently
it was stuck doing "w += 0" due to how few ticks went by within
the loop! :-D
2023-03-14 22:14:15 -07:00
Mark Kim
7103897bc7 Dialog popup animation speed fix
Play the dialog popup animation at a consistent speed across platforms.

Also, fix the issue with dialog box trail not clearing after the final
render.
2023-03-14 18:14:05 -04:00
Bill Kendrick
1bfa5f7a49 Abandoning color grabbing in color mixer
We'll end up with things like "132/245 red, 90/245 yellow, 23/245 blue".
Getting it to work will likely require some massive brute-forcing.
If people want to take an existing color and make subtle changes, they
can just use the rainbow palette HSV color picker.
2023-03-07 00:41:18 -08:00
Bill Kendrick
e913709362 Shape tool improvements
More sensible rotation when using the drag-from-corner mode
(rotates around center of the shape, as you'd expect, rather than
around one of the corners of the shape's bounding box, as it has
been doing all this time).

Stretching a shape from bottom to top causes an upside-down shape
(e.g., before, a triangle would always start out up-pointing
regardless as to whether you clicked and drag downwards or upwards;
now, it will start out down-pointing if you drag upwards when
initially placing & stretching the shape).
2023-03-06 01:07:13 -08:00
Bill Kendrick
36eb2ea70c Sync docs for cross-color stuff, and...
...deactivate all code for this within color mixer, since it's
not actually implemented yet (going to be tricky! -- probably
holding off to a future version).

Also, sound effect for cross-color grabbing within rainbow palette
dialog.
2023-03-03 01:54:20 -08:00
Bill Kendrick
75de6f23ea Color grabbing icon for new cross-color-tool feature
Also, update (c) year! (Skipped 2022, oops!)
2023-03-03 01:34:22 -08:00