Commit graph

2721 commits

Author SHA1 Message Date
Bill Kendrick
964416f476 Color mixer: Showing simplified fractions, too
Say a color is a mix of 5 red, 4 blue, and 1 black.
It will show "5/10 (1/2) red, 4/10 (2/5) blue, 1/10 black."

Also, when adding multiple contributions of only one color (so far),
it will say, e.g., "entirely (3/3) red".
2022-01-28 02:16:33 -08:00
Bill Kendrick
c50fddd604 Color mixer: Undo/Redo seems to be working! 2022-01-28 01:32:29 -08:00
Bill Kendrick
4ae07338bf Color mixer: Break color average calculation out
Needs to be a function that we can also call on Undo & Redo
actions.
2022-01-28 01:00:36 -08:00
Bill Kendrick
3e28289db2 Color mixer: WIP: Undo/Redo feature 2022-01-28 00:55:23 -08:00
Bill Kendrick
336c7cc342 Color mixer: Some better Red/Yellow/Blue primaries
Using HSV values of some subtractive CMYK colors.
2022-01-28 00:24:27 -08:00
Bill Kendrick
a8beb74abe Color mixer: Mixing colors properly
Rather than having a "current color" and averaging it with
the newly-added color, averaging the entire set of colors each time.

Before, if you added R + Y + B, you'd get a different color
than R + B + Y, or Y + B + R, etc.

Now, it starts fresh every time and averages the hues (when applicable),
saturations, and values of each color that's been added to the mix.

R + Y + B (combined in any order) currently always comes out a brownish
orange, as expected.
2022-01-27 23:56:56 -08:00
Bill Kendrick
42ca74df86 Update POT/PO to add new Color Mixer UI elements 2022-01-27 22:54:50 -08:00
Bill Kendrick
4d93bd3177 Color mixer: Display color proportions as you mix
Show the color proportions (e.g., "entirely red", or "1/2 yellow and 1/2 green",
or "1/5 red, 2/5 blue, and 2/5 black") in the Tux tips area.  Show the full
instructions again when the color is reset with the clear button.

(Also, label clear (trash) button with the word "Clear".)
2022-01-27 22:37:13 -08:00
Bill Kendrick
150e524867 Color mixer: Undo/Redo appear properly; color tweaks
Adjust HSV values for Red/Yellow/Blue. When drawing color,
drop V value very slightly (so white appears off-white).

Undo & Redo now have black icons/text if available, else grey.
2022-01-27 21:25:04 -08:00
Bill Kendrick
268d063f71 Color Mixer: Show Undo/Redo & handle cursor shape
Undo/Redo don't do anything yet. Other buttons now cause mouse
to change to 'hand' (vs 'arrow') shape when hovering over them.
2022-01-27 21:07:19 -08:00
Bill Kendrick
793ee8fd50 Color mixer working okay now!
I'd like to add undo/redo, and the trash button needs a label,
but it's usable!
2022-01-27 02:39:46 -08:00
Bill Kendrick
92499d9a70 WIP More work on color mixer
Tweaks to icon. Further modularized how color button rendering works,
so it can handle selector (pipette) and mixer overlay icons.
Mixer function is basically identical to color picker (rainbow palette)
as a placeholder. WORK IN PROGRESS.
2022-01-27 00:08:56 -08:00
Bill Kendrick
db7a8c0124 WIP Starting to make a color mixer tool
Also, modularize color picker's & color selector's method of
generating a fresh version of their active/inactive buttons,
after a color has been chosen by their tool.
2022-01-26 22:43:06 -08:00
Bill Kendrick
83d316a166 Ctrl+click to pick colors immediately
A keyboard shortcut is now available for picking colors from
the canvas more quickly.  Hold either (left or right) [Ctrl] key
while clicking, and the color selector option will appear.
Release the mouse button over a color on the canvas to choose it
(or outside the canvas to abort).
Closes https://sourceforge.net/p/tuxpaint/feature-requests/209/

Also,
 * Don't play 'bubble' paint sound when color picker or selector
   are aborted (e.g., via their "Back" buttons).
 * Replace many instances of "NUM_COLOR - 1" and "NUM_COLOR - 2"
   (which correspond to color chose via picker (palette) and
   selector (canvas), respectively) with #define's that
   represent them. (Avoid magic numbers.)
2022-01-26 01:07:11 -08:00
Bill Kendrick
269f0cfe3a Rigging up do_color_sel() to offer immediate mode
The pick-a-color-from-the-canvas color selection feature
(the option in the color palette showing a pipette icon)
has been extended to support an immediate mode (return on
"mouse-up" event, don't show a "Back" button, and don't animate
the appearance of the color dialog at the bottom),
which will be used by a forthcoming feature that will offer
a keyboard shortcut to bring up this color selection option.
2022-01-26 00:20:14 -08:00
Bill Kendrick
e0d7e0728b Show "pipette"-shaped pointer when selecting colors 2022-01-25 23:57:31 -08:00
Bill Kendrick
6735340566 Stamp performance improvements
+ Stamps are scaled before they are colorized or tinted,
   to increase performance.
 + The current stamp (in its current form: size, orientation,
   and color) is cached, so it may be applied to the canvas
   many times without having to re-render.
   (No longer scaling and tinting every time you click.)

Closes https://sourceforge.net/p/tuxpaint/bugs/147/
(h/t Andre Anckaert)
2022-01-25 22:21:55 -08:00
Bill Kendrick
3518433808 Better onscreen keyboard button sizing
No longer restricted to "the same as other UI buttons"
(e.g., 48x48 default) or "1/4th that size" (e.g., 24x24).
Will scale, allowing for larger buttons when appropriate.
h/t Anat Caspi for pointing out the continuing issue.

Closes https://sourceforge.net/p/tuxpaint/feature-requests/212/
2022-01-25 00:52:14 -08:00
Bill Kendrick
be7d33fa23 Mend broken star shape fill
Was missing some array elements (but no warnings!?)
h/t Shin-ichi for catching it
2022-01-21 01:38:25 -08:00
Bill Kendrick
251259ab13 PO/POT update after adding shape + aspect ratio tip 2022-01-21 01:33:45 -08:00
Bill Kendrick
16e7cb1f59 Showing aspect ratio of shapes when stretching them
...in the Tux tips area
2022-01-21 01:33:23 -08:00
Bill Kendrick
9f5769855b PO/POT update after adding heptagon 2022-01-21 00:34:33 -08:00
Bill Kendrick
71c2404838 Added heptagon (7-sided) shape
Also, using floats more, allowing for proper heptagon support, as
well as a non-skewed starting angle for octagons (22.5 degrees).
2022-01-21 00:34:10 -08:00
Bill Kendrick
1050e74336 PO/POT refresh after adding hexagon shape tool 2022-01-21 00:02:44 -08:00
Bill Kendrick
e210f5592c Add "hexagon" to shapes tool
How'd we last so long without one!?
2022-01-21 00:01:50 -08:00
Mark Kim
c239e849cb Correct comment 2022-01-20 20:46:18 -05:00
Mark Kim
3b03467d62 On macOS use the CMD key wherever CTRL is used on other OS 2022-01-20 20:44:07 -05:00
Pere Pujal i Carabantes
e9ebd54db9 Merging brush spacing work into sdl2.0 2022-01-20 21:33:57 +01:00
Bill Kendrick
e8446d2902 Brush spacing controls work 2022-01-20 00:09:03 -08:00
Bill Kendrick
ccfe3bc074 FIXME about hand cursor over selector controls 2022-01-19 02:12:59 -08:00
Bill Kendrick
29eec0dcb7 Brush spacing ctrl proper position when no scrollbar
(e.g., when running in ~860px tall window with 32px buttonsize)
2022-01-19 02:04:47 -08:00
Bill Kendrick
145c35a95d Get brush selector down-scroll to grok brush spacing 2022-01-19 01:46:44 -08:00
Bill Kendrick
0b18aac985 Decided how brush spacing choice relates to spacing
Max option in the spacing widget will correspond to 2x the maximum
dimension of the brush.
2022-01-19 01:30:08 -08:00
Bill Kendrick
ce9e264713 Initial work to render brush spacing widget
Doesn't do anything yet, and click-detecting code is unaware of it
(so scrollbar click happens in the old location).  WIP! :-)
2022-01-19 00:38:03 -08:00
Bill Kendrick
176749ba9c Grok "[no]brushspacing" commandline/config option
For forthcoming feature
2022-01-19 00:29:05 -08:00
Bill Kendrick
774954f9fc Sync docs & update bash completion re: brushspacing 2022-01-19 00:00:57 -08:00
Bill Kendrick
e1a721fb9d Outline for circle-shaped erasers is now also circular
Closes https://sourceforge.net/p/tuxpaint/bugs/244/
2022-01-18 23:28:53 -08:00
Pere Pujal i Carabantes
88f689c744 Uppercase fix for Turkish. Make use of full allocated space of ustr. 2022-01-01 19:58:36 +01:00
dolphin6k
be5cbc22ba Fixed abnormal exit of threaded font scan which prevented enabling text/label tools on some environment such as Rocky Linux 8. 2022-01-01 19:51:31 +01:00
dolphin6k
c67dfbc562 Fixed abnormal exit of threaded font scan which prevented enabling text/label tools on some environment such as Rocky Linux 8. 2021-12-22 22:24:53 +09:00
Pere Pujal i Carabantes
35dd1fb4ce Correcting syntax. 2021-12-21 00:31:05 +01:00
Pere Pujal i Carabantes
7ea62cf0fe Better approach to mbstowcs and wcstombs by TOYAMA Shin-ichi. Makes --uppercase working too for accented letters, discarding mtw. 2021-12-16 20:29:10 +01:00
Pere Pujal i Carabantes
4749214383 Onscreen keyboard working on Windows, by TOYAMA Shin-ichi. 2021-12-15 20:35:43 +01:00
Pere Pujal i Carabantes
7bc0e2c157 Initializing layout of osk to avoid undefined behavior when changing keyboards. 2021-12-12 01:52:19 +01:00
Pere Pujal i Carabantes
7e9990a6d6 Merge branch 'master' into sdl2.0 2021-12-10 11:29:59 +01:00
Bill Kendrick
ac6aee7a43 Update src/po/check_translations.sh to work again
Docs shuffled around & gettext'ing a string in Tux Paint Config.
changed, which caused it to not find things.
2021-12-02 00:28:26 -08:00
Bill Kendrick
200df10456 Albanian translation update
h/t Besnik Bleta
2021-12-01 23:52:12 -08:00
Bill Kendrick
1c61f1b7f8 Doc'ing Slovak l10n update & adding contributor
Welcome Jozef!

(Also bump project-id-version in sk.po)
2021-12-01 22:28:35 -08:00
Jose Riha
de7f0cf857 Update Slovak translation. 2021-11-30 10:30:41 +01:00
Pere Pujal i Carabantes
fa071f85b8 Merge master 0.9.27 commit into sdl2.0 2021-11-25 20:03:30 +01:00