Commit graph

1308 commits

Author SHA1 Message Date
Bill Kendrick
6fd0517f1e Modifying stamp rotation process: easier 0 degree
Rotation off of zero (0) degrees only occurs when dragging outside
the bounding box (rectangle around the width/height) of the stamp.

No longer warping mouse to the right of the stamp, to cause it to
default to zero degrees.  (The mouse being at the center of the
stamp now causes this, per the above change.)

Motivation - Placing stamps on mobile (touchscreen) was difficult
and non-intuitive.  Now, you can at least double-tap the same
spot on the screen to position, and then place (without rotation)
the stamp.  It's still not perfect, and I think a UI option to
enable/disable stamp rotation (leaving it off by default) is needed.
2023-02-18 12:14:16 -08:00
Bill Kendrick
ed6e3da74f Change most printfs to DEBUG_PRINTF()
Avoids need to wrap tons of things in #ifdef DEBUG ... #endif
2023-02-16 01:08:41 -08:00
Bill Kendrick
eaeebdc7a6 Starter scale option support; set some options 2023-02-16 00:29:51 -08:00
Bill Kendrick
7e99b05510 Clean up more "unused variable" warnings 2023-02-12 13:25:59 -08:00
Bill Kendrick
17eb62e554 Template/Starter options: Ability to specify gravity
e.g. if the aspect ratio of the template/starter is wider than
that of the canvas, and "autoscale=vertical" (or "=both")
is specified, before it would chop the top and bottom of the
image off, displaying the vertical center of it on the canvas.
Now you can ask it to gravitate towards the top or bottom, if they
have content that's of higher significance than the opposite side.

h/t Pere & Albert for the suggestion.

TODO - Document, set some suitable defaults for images we ship.
2023-02-12 10:39:58 -08:00
Bill Kendrick
03c57cc721 More WIP starter/template scaling
Need to actually scale, if we have no background.
2023-02-10 02:08:14 -08:00
Bill Kendrick
9b93805ef6 [WIP] Starter/Template scale/smear/bkgd color options
Now possible to set scaling and smearing options for
each starter or template image.  A ".dat" file can be
created which describes whether it's okay to scale and crop
the image's top/bottom and/or left/right, and if not both,
whether to smear the sides of the starter/template to the
edges of the canvas (the prior behavior, and the default),
or use a specific solid color background.

Once finished, will close
https://sourceforge.net/p/tuxpaint/feature-requests/190/

Still to do:
 + Document
 + Remove debugging printf()s (change to DEBUG_PRINTF()?)
 + Add files for starters & templates that ship with Tux Paint
 + Test!
2023-02-10 01:58:49 -08:00
Bill Kendrick
34de8311db Zoom/Perspective: Support background color changes
When in the middle of adjusting a drawing with Zoom or Perspective,
you could change the color.  However, the background would not
relfect this until you further adjusted the zoom/perspective.

Now, a color change causes the background to update immediately.

This involved updating the Tux Paint Magic API to send more
arguments to each Magic tool's "XYZ_set_color()" function,
which means a bump in the API version.

(Forthcoming, all other Magic tools will have their set_color()
functions updated.)
2023-01-25 02:12:57 -08:00
Bill Kendrick
bf7e8897d6 Remove unfinished "Label" text on New or Open
Text from unfinished "Label" tool input would appear after
creating a New image or Opening an existing one.  Mended.
Closes https://sourceforge.net/p/tuxpaint/bugs/246/

Mostly by Pere.
2023-01-23 22:04:00 -08:00
Bill Kendrick
51c270b519 Avoid window larger than sole display size is capable of
If only one display is available, when running in windowed mode
and asking for Tux Paint to appear in a width and/or height larger
than the display's dimensions, Tux Paint will fall back to
the maximum(s) the display is capable of.

e.g., on my laptop with 1920x1080, running "tuxpaint --2048x2048"
will fall back to 1920x1080 (and display a warning to stdout).
However, if I have my external monitor (also 1920x1080) attached,
it will happily open a 2048x2048 window.  Not perfect, but an
improvement.

Closes https://sourceforge.net/p/tuxpaint/feature-requests/113/
2023-01-19 00:56:07 -08:00
Bill Kendrick
949438e2fb Bring back support for SDL_VIDEO_WINDOW_POS envvar
SDL1.2 supported "SDL_VIDEO_WINDOW_POS" environment variable,
but SDL2 does not; so reimplemented it ourselves. (See ENVARS docs.)
2023-01-19 00:18:52 -08:00
Bill Kendrick
b373ac8808 WIP - Crop whitespace from label text for better fit
For example, when using a font like OpenDyslexia which has a very
large line spacing, the text gets shrunk since the overall bitmap
is too big for the space on the buttons (compared to the contents).

Cropping the whitespace will allow the text to remain larger.

WIP - The method of cropping isn't great.  Text with descenders
appear higher than text without, causing terrible alignment.
So for now, the new `crop_surface()` code is not being used.

Also, replace some "#ifdef DEBUG printf(...) #endif" with
a simple "DEBUG_PRINTF(...)".  And other minor tweaks.
2023-01-11 01:56:11 -08:00
Bill Kendrick
65852f2534 Corrected 'keep aspect ration' option in zoom()
Scaling of button labels often caused them to stretch wider
than they should have.  (e.g., "tuxpaint --1024x768 --buttonsize=78")
2023-01-11 00:46:31 -08:00
Bill Kendrick
35dbd40bf6 Disallow Ctrl-Z in certain situations
Closes https://sourceforge.net/p/tuxpaint/bugs/239/
2023-01-03 22:30:45 -08:00
Bill Kendrick
7a1c90031c Disabling anniversary confetti animation on title screen 2022-12-28 21:03:39 -08:00
Bill Kendrick
0517b4392c Update URL to https://tuxpaint.org/ everywhere
Also, add other social media accounts to list of places to
announce Tux Paint in RELEASE docs.

Also, list a ton more options missing from default example config file
"src/tuxpaint.conf"
2022-12-11 01:29:25 -08:00
Bill Kendrick
1f22332415 Use Japanese characters, not "Aa", in font selector when available
Also closes https://sourceforge.net/p/tuxpaint/bugs/266/ by
using code based on Pere's patch.  Thanks to Shin-ichi & Pere!
2022-12-09 22:11:32 -08:00
Mark Kim
3849480fd4 Pango loads Tux Paint-supplied fonts on macOS.
Previously Pango loaded system-supplied fonts instead, which could lead
to fonts not rendering in a human-readable text.  This change fixes
https://sourceforge.net/p/tuxpaint/bugs/265/
2022-12-02 22:57:38 -05:00
dolphin6k
e9a0d7aaf5 Removed warning regarding fribidi_log2vis(). 2022-11-18 14:16:23 +09:00
dolphin6k
f3d177621b Corrected compile-time error on old platforms (ex: RHEL7) 2022-11-18 12:10:35 +09:00
Bill Kendrick
9d70b5837c WIP: Cleaned up some compile-time warnings...
...that cropped up in SDL2 branch.
2022-11-14 23:21:45 -08:00
Bill Kendrick
a530896e20 Squelch a debug output
s/printf(...)/DEBUG_PRINTF(...)/
2022-11-14 22:55:09 -08:00
Bill Kendrick
16839df8ba Brush spacing improvements
Each brush's initial spacing (calculated, or loaded
from .dat file) is recorded.  When the spacing UI
is used to select a close, but not-precisely-the-same,
spacing option, the default is chosen ("nudged" to it).

h/t Pere for pointing this out (e.g., "aa_round_seethru_05.png")

Also, meter's lowest value has a sliver dark blue.
2022-10-25 00:36:58 -07:00
Bill Kendrick
632459087e Better performance from "Rush" (by using SDL_gfx rotozoom)
Applying patch from Pere.  ALSO, bumping Tux Paint Magic Tool API version.
2022-10-03 22:50:40 -07:00
Mark Kim
371d9cdbd8 stop quick eraser when the mouse button is released
Ensure quick eraser stops when the mouse button is released even when
SDL events continue to trigger.
2022-09-29 18:49:50 -04:00
Bill Kendrick
9be4fa529f [X] instead of [Del] for eraser quick access
Apple keyboards have only a "Delete" key (which acts as Backspace),
so contortions with Fn key required to access the keysym I was
using for eraser quick access.  h/t Mark Kim for pointing it out.

Because of this use of a printable glyph key, and to solve the
issue of on screen keyboard and in-progress text input getting
clobbered while accessing eraser, preventing access to the
quick eraser when either Text or Label tool are selected.
2022-09-28 22:00:29 -07:00
Bill Kendrick
e3570eb707 List avail "--joystick-btn-..." commands in --help output 2022-09-28 01:52:16 -07:00
Bill Kendrick
7a780c2f6b Add "--buttonsize=auto" to --help usage output 2022-09-28 01:47:50 -07:00
Bill Kendrick
f02459af87 [Del] quick eraser: avoid conflict; record undo buffer 2022-09-28 01:17:08 -07:00
Bill Kendrick
65d1c087d6 [Del] key to quickly access a small eraser
A keyboard shortcut is now available for quickly accessing
a small eraser.  Hold the [Del] key while clicking, and drag
around the picture to erase.  Release the key and/or mouse to
return to normal operation.

(Eventually, this could be utilized when we can support
the recognition of a drawing tablet stylus' "eraser" tip;
see https://sourceforge.net/p/tuxpaint/feature-requests/8/)
2022-09-28 01:00:28 -07:00
Bill Kendrick
9edb6effa6 Set SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH 2022-09-15 00:39:58 -07:00
Bill Kendrick
cc05925d9e Re-ran indent on all .c & .h source code files
Like so --
  find . -name "*.c" -or -name "*.h" -exec  indent -nbfda -npcs -npsl -bli0 --no-tabs {} \;

The `indent` invocation differs from the last one noted in
CHANGES.txt (from 2006!?), in that I've added "--no-tabs",
to ensure indents are all space-based.
2022-09-15 00:14:20 -07:00
Bill Kendrick
09f332367f Mend bug where Ctrl+click pipette got stuck drawing 2022-09-14 23:41:48 -07:00
Bill Kendrick
a466fce43a --verbose-version: Show whether SDL2_Pango is used 2022-09-14 15:25:38 -07:00
Pere Pujal i Carabantes
82676e3fb1 Stamp XORs behaving better with CTRL-key commands, still not finished. 2022-09-12 02:00:28 +02:00
Bill Kendrick
eaba5e94f4 Stamps -> Rotation: Better mouse warping
Stamp width needed to be cut in half, since stamp's _center_ is
at the click (old_x) position.  Also, avoid warping outside of the
canvas.
2022-09-11 11:05:01 -07:00
Pere Pujal i Carabantes
cc28f48f7e Fixing stale XOR left when rotating then click on another stamp image before finish rotation. Also counting button size when warping mouse. 2022-09-11 14:41:40 +02:00
Pere Pujal i Carabantes
1a1a4bb50b Speed up stamp rotation XOR rendering. Freeing surface previously left unfreed. 2022-09-11 11:04:54 +02:00
Bill Kendrick
9c25b2fda5 Stamp rotation on by default 2022-09-05 00:42:03 -07:00
Bill Kendrick
270f5353e0 Mend drop-shadows on prompts
...they were not rendering the way we were doing it in the sdl2.0
branch.
2022-09-05 00:04:52 -07:00
Bill Kendrick
53c1c5e995 Create "canvas" as 24-bit all the time
Previously was having it match the display's ("screen"'s) depth
and masks, but this apparently causes artifacts under SDL2.
Closes https://sourceforge.net/p/tuxpaint/bugs/259/
2022-09-04 01:33:36 -07:00
Bill Kendrick
c171500d5e Stamp rotation - Warp mouse to the right, at start
...this ensures that any immediate mouse movement at the
beginning of the rotation process will affect the angle only
slightly.  (As opposed to leaving it in the center of the
stamped shape; moving slightly left would rotate the shape
~180 degrees immediately, for example).

Also, updated date in CHANGES and src/tuxpaint.c, added
new feature to CHANGES, and credited Pere.  (Great work!!!)
2022-09-02 02:05:52 -07:00
Pere Pujal i Carabantes
a433b4c79c Adding stamp rotation. The xor interface seems to work fine if only the mouse is used, still need to adapt it to shortcut key combos. 2022-09-02 02:11:43 +02:00
Pere Pujal i Carabantes
73c1cabac1 Android fix for magic tools under 64 bits devices by Terrence Sheflin, see 345d3cc78a 2022-07-20 23:38:04 +02:00
Bill Kendrick
da15f8c282 Changing Android save paths to now default to the 'external' dir from the device itself.
Merging the src/tuxpaint.c change from
https://github.com/tux4kids/Tuxpaint-Android/pull/18
(e23803b1f2)

Per Terrence
2022-07-07 17:44:51 -07:00
Bill Kendrick
60120b763c Merge branch 'master' into sdl2.0 2022-07-03 19:58:34 -07:00
Bill Kendrick
e984f23b5f Line: Never say "360 degrees" (say "0")
h/t Karl

Closes https://sourceforge.net/p/tuxpaint/bugs/255/
2022-07-03 16:09:48 -07:00
Mark Kim
ed885f887d macOS: move deleted file to Trash
As opposed to permanently deleting it.  As requested:

  https://sourceforge.net/p/tuxpaint/feature-requests/148/
2022-07-02 22:09:55 -04:00
Mark Kim
98198591b5 macOS: move deleted file to Trash
As opposed to permanently deleting it.  As requested:

  https://sourceforge.net/p/tuxpaint/feature-requests/148/
2022-07-02 22:03:41 -04:00
Pere Pujal i Carabantes
b612fcb881 Something weird happened in load_info_about_label_surface() in some merge, fixing the merge. 2022-06-20 23:08:02 +02:00