Docs translations and fill improvements Merge branch 'master' into sdl2.0
This commit is contained in:
commit
96e934e639
92 changed files with 15415 additions and 3793 deletions
235
src/fill.c
235
src/fill.c
|
|
@ -27,7 +27,7 @@
|
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
(See COPYING.txt)
|
||||
|
||||
Last updated: September 14, 2019
|
||||
Last updated: March 8, 2021
|
||||
$Id$
|
||||
*/
|
||||
|
||||
|
|
@ -43,14 +43,28 @@
|
|||
#include "rgblinear.h"
|
||||
#include "playsound.h"
|
||||
#include "pixels.h"
|
||||
#include "progressbar.h"
|
||||
|
||||
|
||||
/* How close colors need to be to match all the time */
|
||||
#define COLOR_MATCH_NARROW 0.04
|
||||
|
||||
/* How close colors can be to match for a few pixels */
|
||||
#define COLOR_MATCH_WIDE 0.60
|
||||
|
||||
/* How many pixels can we allow a wide match before stopping? */
|
||||
#define WIDE_MATCH_THRESHOLD 3
|
||||
|
||||
|
||||
/* Local function prototypes: */
|
||||
|
||||
int colors_close(SDL_Surface * canvas, Uint32 c1, Uint32 c2);
|
||||
double colors_close(SDL_Surface * canvas, Uint32 c1, Uint32 c2);
|
||||
Uint32 blend(SDL_Surface * canvas, Uint32 draw_colr, Uint32 old_colr, double pct);
|
||||
void simulate_flood_fill_outside_check(SDL_Surface * screen, SDL_Surface * last, SDL_Surface * canvas, int x, int y, Uint32 cur_colr, Uint32 old_colr, int * x1, int * y1, int * x2, int * y2, Uint8 * touched, int y_outside);
|
||||
|
||||
|
||||
int colors_close(SDL_Surface * canvas, Uint32 c1, Uint32 c2)
|
||||
/* Returns how similar colors 'c1' and 'c2' are */
|
||||
double colors_close(SDL_Surface * canvas, Uint32 c1, Uint32 c2)
|
||||
{
|
||||
Uint8 r1, g1, b1, r2, g2, b2;
|
||||
|
||||
|
|
@ -58,7 +72,7 @@ int colors_close(SDL_Surface * canvas, Uint32 c1, Uint32 c2)
|
|||
{
|
||||
/* Get it over with quick, if possible! */
|
||||
|
||||
return 1;
|
||||
return 0.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -79,14 +93,13 @@ int colors_close(SDL_Surface * canvas, Uint32 c1, Uint32 c2)
|
|||
// dark grey, brown, purple
|
||||
// light grey, tan
|
||||
// red, orange
|
||||
return r + g + b < 0.04;
|
||||
return (r + g + b);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int would_flood_fill(SDL_Surface * canvas, Uint32 cur_colr, Uint32 old_colr)
|
||||
{
|
||||
if (cur_colr == old_colr || colors_close(canvas, cur_colr, old_colr))
|
||||
if (colors_close(canvas, cur_colr, old_colr) < COLOR_MATCH_NARROW)
|
||||
{
|
||||
return 0;
|
||||
} else {
|
||||
|
|
@ -94,19 +107,47 @@ int would_flood_fill(SDL_Surface * canvas, Uint32 cur_colr, Uint32 old_colr)
|
|||
}
|
||||
}
|
||||
|
||||
void do_flood_fill(SDL_Surface * canvas, int x, int y, Uint32 cur_colr, Uint32 old_colr, int * x1, int * y1, int * x2, int * y2)
|
||||
void do_flood_fill(SDL_Surface * screen, SDL_Surface * last, SDL_Surface * canvas, int x, int y, Uint32 cur_colr, Uint32 old_colr, int * x1, int * y1, int * x2, int * y2, Uint8 * touched)
|
||||
{
|
||||
simulate_flood_fill(canvas, x, y, cur_colr, old_colr, x1, y1, x2, y2, NULL);
|
||||
simulate_flood_fill(screen, last, canvas, x, y, cur_colr, old_colr, x1, y1, x2, y2, touched);
|
||||
}
|
||||
|
||||
|
||||
void simulate_flood_fill(SDL_Surface * canvas, int x, int y, Uint32 cur_colr, Uint32 old_colr, int * x1, int * y1, int * x2, int * y2, Uint8 * touched)
|
||||
Uint32 blend(SDL_Surface * canvas, Uint32 draw_colr, Uint32 old_colr, double pct) {
|
||||
Uint8 old_r, old_g, old_b, draw_r, draw_g, draw_b, new_r, new_g, new_b;
|
||||
|
||||
SDL_GetRGB(draw_colr, canvas->format, &draw_r, &draw_g, &draw_b);
|
||||
SDL_GetRGB(old_colr, canvas->format, &old_r, &old_g, &old_b);
|
||||
|
||||
new_r = (Uint8) (((float) old_r) * (1.00 - pct) + ((float) draw_r * pct));
|
||||
new_g = (Uint8) (((float) old_g) * (1.00 - pct) + ((float) draw_g * pct));
|
||||
new_b = (Uint8) (((float) old_b) * (1.00 - pct) + ((float) draw_b * pct));
|
||||
|
||||
return SDL_MapRGB(canvas->format, draw_r, draw_g, draw_b);
|
||||
return SDL_MapRGB(canvas->format, new_r, new_g, new_b);
|
||||
}
|
||||
|
||||
void simulate_flood_fill(SDL_Surface * screen, SDL_Surface * last, SDL_Surface * canvas, int x, int y, Uint32 cur_colr, Uint32 old_colr, int * x1, int * y1, int * x2, int * y2, Uint8 * touched) {
|
||||
simulate_flood_fill_outside_check(screen, last, canvas, x, y, cur_colr, old_colr, x1, y1, x2, y2, touched, 0);
|
||||
}
|
||||
|
||||
void simulate_flood_fill_outside_check(SDL_Surface * screen, SDL_Surface * last, SDL_Surface * canvas, int x, int y, Uint32 cur_colr, Uint32 old_colr, int * x1, int * y1, int * x2, int * y2, Uint8 * touched, int y_outside)
|
||||
{
|
||||
int fillL, fillR, i, in_line;
|
||||
int fillL, fillR, narrowFillL, narrowFillR, i, outside;
|
||||
double in_line, closeness;
|
||||
static unsigned char prog_anim;
|
||||
Uint32 px_colr;
|
||||
|
||||
|
||||
if (cur_colr == old_colr || colors_close(canvas, cur_colr, old_colr))
|
||||
/* "Same" color? No need to fill */
|
||||
if (!would_flood_fill(canvas, cur_colr, old_colr))
|
||||
return;
|
||||
|
||||
if (x < 0 || x >= canvas->w || y < 0 || y >= canvas->h)
|
||||
return;
|
||||
|
||||
/* Don't re-visit the same pixel */
|
||||
if (touched && touched[(y * canvas->w) + x])
|
||||
return;
|
||||
|
||||
if (y < *y1)
|
||||
|
|
@ -121,31 +162,62 @@ void simulate_flood_fill(SDL_Surface * canvas, int x, int y, Uint32 cur_colr, Ui
|
|||
|
||||
fillL = x;
|
||||
fillR = x;
|
||||
narrowFillL = x;
|
||||
narrowFillR = x;
|
||||
|
||||
prog_anim++;
|
||||
if ((prog_anim % 4) == 0)
|
||||
{
|
||||
/* FIXME: api->update_progress_bar(); */
|
||||
show_progress_bar(screen);
|
||||
playsound(canvas, 1, SND_FILL, 1, x, SNDDIST_NEAR);
|
||||
}
|
||||
|
||||
|
||||
/* Find left side, filling along the way */
|
||||
|
||||
in_line = 1;
|
||||
|
||||
while (in_line)
|
||||
px_colr = getpixels[last->format->BytesPerPixel] (last, fillL /* - 1 */, y);
|
||||
in_line = colors_close(canvas, px_colr, old_colr);
|
||||
outside = 0;
|
||||
while (in_line < COLOR_MATCH_WIDE && outside < WIDE_MATCH_THRESHOLD)
|
||||
{
|
||||
if (touched != NULL) {
|
||||
touched[(y * canvas->w) + fillL] = 1;
|
||||
if (in_line > COLOR_MATCH_NARROW) {
|
||||
outside++;
|
||||
} else {
|
||||
narrowFillL = fillL;
|
||||
}
|
||||
|
||||
putpixels[canvas->format->BytesPerPixel] (canvas, fillL, y, cur_colr);
|
||||
if (touched != NULL) {
|
||||
touched[(y * canvas->w) + fillL] = (255 - ((Uint8) (in_line * 85)));
|
||||
}
|
||||
|
||||
px_colr = getpixels[last->format->BytesPerPixel] (last, fillL, y);
|
||||
putpixels[canvas->format->BytesPerPixel] (canvas, fillL, y, blend(canvas, cur_colr, px_colr, (1.0 - in_line)));
|
||||
fillL--;
|
||||
|
||||
in_line = (fillL < 0) ? 0 : colors_close(canvas, getpixels[canvas->format->BytesPerPixel] (canvas, fillL, y), old_colr);
|
||||
px_colr = getpixels[last->format->BytesPerPixel] (last, fillL, y);
|
||||
|
||||
if (fillL >= 0)
|
||||
{
|
||||
in_line = colors_close(canvas, px_colr, old_colr);
|
||||
}
|
||||
else
|
||||
{
|
||||
in_line = 3.0;
|
||||
}
|
||||
}
|
||||
|
||||
if (fillL >= 0)
|
||||
{
|
||||
if (touched != NULL)
|
||||
{
|
||||
touched[(y * canvas->w) + fillL] = (255 - ((Uint8) (in_line * 85)));
|
||||
}
|
||||
|
||||
px_colr = getpixels[last->format->BytesPerPixel] (last, fillL, y);
|
||||
putpixels[canvas->format->BytesPerPixel] (canvas, fillL, y, blend(canvas, cur_colr, px_colr, (1.0 - in_line)));
|
||||
}
|
||||
|
||||
|
||||
if (fillL < *x1)
|
||||
{
|
||||
*x1 = fillL;
|
||||
|
|
@ -153,18 +225,49 @@ void simulate_flood_fill(SDL_Surface * canvas, int x, int y, Uint32 cur_colr, Ui
|
|||
|
||||
fillL++;
|
||||
|
||||
|
||||
/* Find right side, filling along the way */
|
||||
|
||||
in_line = 1;
|
||||
while (in_line)
|
||||
px_colr = getpixels[last->format->BytesPerPixel] (last, fillR + 1, y);
|
||||
in_line = colors_close(canvas, px_colr, old_colr);
|
||||
outside = 0;
|
||||
while (in_line < COLOR_MATCH_WIDE && outside < WIDE_MATCH_THRESHOLD)
|
||||
{
|
||||
if (touched != NULL) {
|
||||
touched[(y * canvas->w) + fillR] = 1;
|
||||
if (in_line > COLOR_MATCH_NARROW) {
|
||||
outside++;
|
||||
} else {
|
||||
narrowFillR = fillR;
|
||||
}
|
||||
putpixels[canvas->format->BytesPerPixel] (canvas, fillR, y, cur_colr);
|
||||
|
||||
if (touched != NULL) {
|
||||
touched[(y * canvas->w) + fillR] = (255 - ((Uint8) (in_line * 85)));
|
||||
}
|
||||
|
||||
px_colr = getpixels[last->format->BytesPerPixel] (last, fillR, y);
|
||||
putpixels[canvas->format->BytesPerPixel] (canvas, fillR, y, blend(canvas, cur_colr, px_colr, (1.0 - in_line)));
|
||||
fillR++;
|
||||
|
||||
in_line = (fillR >= canvas->w) ? 0 : colors_close(canvas, getpixels[canvas->format->BytesPerPixel] (canvas, fillR, y), old_colr);
|
||||
px_colr = getpixels[last->format->BytesPerPixel] (last, fillR, y);
|
||||
|
||||
if (fillR < canvas->w)
|
||||
{
|
||||
in_line = colors_close(canvas, px_colr, old_colr);
|
||||
}
|
||||
else
|
||||
{
|
||||
in_line = 3.0;
|
||||
}
|
||||
}
|
||||
|
||||
if (fillR < canvas->w)
|
||||
{
|
||||
if (touched != NULL)
|
||||
{
|
||||
touched[(y * canvas->w) + fillR] = (255 - ((Uint8) (in_line * 85)));
|
||||
}
|
||||
|
||||
px_colr = getpixels[last->format->BytesPerPixel] (last, fillR, y);
|
||||
putpixels[canvas->format->BytesPerPixel] (canvas, fillR, y, blend(canvas, cur_colr, px_colr, (1.0 - in_line)));
|
||||
}
|
||||
|
||||
if (fillR > *x2)
|
||||
|
|
@ -177,13 +280,31 @@ void simulate_flood_fill(SDL_Surface * canvas, int x, int y, Uint32 cur_colr, Ui
|
|||
|
||||
/* Search top and bottom */
|
||||
|
||||
for (i = fillL; i <= fillR; i++)
|
||||
for (i = narrowFillL; i <= narrowFillR; i++)
|
||||
{
|
||||
if (y > 0 && colors_close(canvas, getpixels[canvas->format->BytesPerPixel] (canvas, i, y - 1), old_colr))
|
||||
simulate_flood_fill(canvas, i, y - 1, cur_colr, old_colr, x1, y1, x2, y2, touched);
|
||||
px_colr = getpixels[last->format->BytesPerPixel] (last, i, y - 1);
|
||||
closeness = colors_close(canvas, px_colr, old_colr);
|
||||
if (y > 0 &&
|
||||
(
|
||||
closeness < COLOR_MATCH_NARROW ||
|
||||
(closeness < COLOR_MATCH_WIDE && y_outside < WIDE_MATCH_THRESHOLD)
|
||||
)
|
||||
)
|
||||
{
|
||||
simulate_flood_fill_outside_check(screen, last, canvas, i, y - 1, cur_colr, old_colr, x1, y1, x2, y2, touched, y_outside + 1);
|
||||
}
|
||||
|
||||
if (y < canvas->h && colors_close(canvas, getpixels[canvas->format->BytesPerPixel] (canvas, i, y + 1), old_colr))
|
||||
simulate_flood_fill(canvas, i, y + 1, cur_colr, old_colr, x1, y1, x2, y2, touched);
|
||||
px_colr = getpixels[last->format->BytesPerPixel] (last, i, y + 1);
|
||||
closeness = colors_close(canvas, px_colr, old_colr);
|
||||
if (y < canvas->h &&
|
||||
(
|
||||
closeness < COLOR_MATCH_NARROW ||
|
||||
(closeness < COLOR_MATCH_WIDE && y_outside < WIDE_MATCH_THRESHOLD)
|
||||
)
|
||||
)
|
||||
{
|
||||
simulate_flood_fill_outside_check(screen, last, canvas, i, y + 1, cur_colr, old_colr, x1, y1, x2, y2, touched, y_outside + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -194,7 +315,6 @@ void draw_linear_gradient(SDL_Surface * canvas, SDL_Surface * last,
|
|||
) {
|
||||
Uint32 old_colr, new_colr;
|
||||
int xx, yy;
|
||||
float xd, yd;
|
||||
Uint8 draw_r, draw_g, draw_b, old_r, old_g, old_b, new_r, new_g, new_b;
|
||||
float A, B, C, C1, C2, ratio;
|
||||
|
||||
|
|
@ -220,22 +340,24 @@ void draw_linear_gradient(SDL_Surface * canvas, SDL_Surface * last,
|
|||
|
||||
if (C < C1) {
|
||||
/* At/beyond the click spot (opposite direction of mouse); solid color */
|
||||
putpixels[canvas->format->BytesPerPixel] (canvas, xx, yy, draw_color);
|
||||
ratio = 0.0;
|
||||
} else if (C >= C2) {
|
||||
/* At/beyond the mouse; completely faded out */
|
||||
putpixels[canvas->format->BytesPerPixel] (canvas, xx, yy, old_colr);
|
||||
ratio = 1.0;
|
||||
} else {
|
||||
/* The actual gradient... */
|
||||
|
||||
ratio = (C - C1) / (C2 - C1);
|
||||
|
||||
new_r = (Uint8) (((float) old_r) * ratio + ((float) draw_r * (1.00 - ratio)));
|
||||
new_g = (Uint8) (((float) old_g) * ratio + ((float) draw_g * (1.00 - ratio)));
|
||||
new_b = (Uint8) (((float) old_b) * ratio + ((float) draw_b * (1.00 - ratio)));
|
||||
|
||||
new_colr = SDL_MapRGB(canvas->format, new_r, new_g, new_b);
|
||||
putpixels[canvas->format->BytesPerPixel] (canvas, xx, yy, new_colr);
|
||||
}
|
||||
|
||||
/* Apply fuzziness at any antialiased edges we detected */
|
||||
ratio = (ratio * ((float) touched[yy * canvas->w + xx] / 255.0));
|
||||
|
||||
new_r = (Uint8) (((float) old_r) * ratio + ((float) draw_r * (1.0 - ratio)));
|
||||
new_g = (Uint8) (((float) old_g) * ratio + ((float) draw_g * (1.0 - ratio)));
|
||||
new_b = (Uint8) (((float) old_b) * ratio + ((float) draw_b * (1.0 - ratio)));
|
||||
|
||||
new_colr = SDL_MapRGB(canvas->format, new_r, new_g, new_b);
|
||||
putpixels[canvas->format->BytesPerPixel] (canvas, xx, yy, new_colr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -250,8 +372,10 @@ void draw_radial_gradient(SDL_Surface * canvas, int x_left, int y_top, int x_rig
|
|||
Uint8 draw_r, draw_g, draw_b, old_r, old_g, old_b, new_r, new_g, new_b;
|
||||
|
||||
/* Calculate the max radius of the filled area */
|
||||
xd = (x_right - x_left + 1);
|
||||
yd = (y_bottom - y_top + 1);
|
||||
//xd = (x_right - x_left + 1);
|
||||
//yd = (y_bottom - y_top + 1);
|
||||
xd = max(abs(x - x_right), abs(x - x_left));
|
||||
yd = max(abs(y - y_bottom), abs(y - y_top));
|
||||
rad = sqrt(xd * xd + yd * yd);
|
||||
if (rad == 0) {
|
||||
return;
|
||||
|
|
@ -269,18 +393,23 @@ void draw_radial_gradient(SDL_Surface * canvas, int x_left, int y_top, int x_rig
|
|||
xd = (float) abs(xx - x);
|
||||
yd = (float) abs(yy - y);
|
||||
dist = sqrt(xd * xd + yd * yd);
|
||||
ratio = (dist / rad);
|
||||
if (dist < rad) {
|
||||
ratio = (dist / rad);
|
||||
|
||||
/* Get the old color, and blend it (with a distance-based ratio) with the target color */
|
||||
old_colr = getpixels[canvas->format->BytesPerPixel] (canvas, xx, yy);
|
||||
SDL_GetRGB(old_colr, canvas->format, &old_r, &old_g, &old_b);
|
||||
/* Get the old color, and blend it (with a distance-based ratio) with the target color */
|
||||
old_colr = getpixels[canvas->format->BytesPerPixel] (canvas, xx, yy);
|
||||
SDL_GetRGB(old_colr, canvas->format, &old_r, &old_g, &old_b);
|
||||
|
||||
new_r = (Uint8) (((float) old_r) * ratio + ((float) draw_r * (1.00 - ratio)));
|
||||
new_g = (Uint8) (((float) old_g) * ratio + ((float) draw_g * (1.00 - ratio)));
|
||||
new_b = (Uint8) (((float) old_b) * ratio + ((float) draw_b * (1.00 - ratio)));
|
||||
/* Apply fuzziness at any antialiased edges we detected */
|
||||
ratio = (ratio * ((float) touched[yy * canvas->w + xx] / 255.0));
|
||||
|
||||
new_colr = SDL_MapRGB(canvas->format, new_r, new_g, new_b);
|
||||
putpixels[canvas->format->BytesPerPixel] (canvas, xx, yy, new_colr);
|
||||
new_r = (Uint8) (((float) old_r) * ratio + ((float) draw_r * (1.00 - ratio)));
|
||||
new_g = (Uint8) (((float) old_g) * ratio + ((float) draw_g * (1.00 - ratio)));
|
||||
new_b = (Uint8) (((float) old_b) * ratio + ((float) draw_b * (1.00 - ratio)));
|
||||
|
||||
new_colr = SDL_MapRGB(canvas->format, new_r, new_g, new_b);
|
||||
putpixels[canvas->format->BytesPerPixel] (canvas, xx, yy, new_colr);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
Fill tool
|
||||
Tux Paint - A simple drawing program for children.
|
||||
|
||||
Copyright (c) 2002-2019 by Bill Kendrick and others; see AUTHORS.txt
|
||||
Copyright (c) 2002-2021 by Bill Kendrick and others; see AUTHORS.txt
|
||||
bill@newbreedsoftware.com
|
||||
http://www.tuxpaint.org/
|
||||
|
||||
|
|
@ -27,7 +27,7 @@
|
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
(See COPYING.txt)
|
||||
|
||||
Last updated: February 20, 2021
|
||||
Last updated: March 8, 2021
|
||||
$Id$
|
||||
*/
|
||||
|
||||
|
|
@ -37,8 +37,8 @@
|
|||
#include "SDL.h"
|
||||
|
||||
int would_flood_fill(SDL_Surface * canvas, Uint32 cur_colr, Uint32 old_colr);
|
||||
void do_flood_fill(SDL_Surface * canvas, int x, int y, Uint32 cur_colr, Uint32 old_colr, int * x1, int * y1, int * x2, int * y2);
|
||||
void simulate_flood_fill(SDL_Surface * canvas, int x, int y, Uint32 cur_colr, Uint32 old_colr, int * x1, int * y1, int * x2, int * y2, Uint8 * touched);
|
||||
void do_flood_fill(SDL_Surface * screen, SDL_Surface * last, SDL_Surface * canvas, int x, int y, Uint32 cur_colr, Uint32 old_colr, int * x1, int * y1, int * x2, int * y2, Uint8 * touched);
|
||||
void simulate_flood_fill(SDL_Surface * screen, SDL_Surface * last, SDL_Surface * canvas, int x, int y, Uint32 cur_colr, Uint32 old_colr, int * x1, int * y1, int * x2, int * y2, Uint8 * touched);
|
||||
void draw_linear_gradient(SDL_Surface * canvas, SDL_Surface * last,
|
||||
int x_left, int y_top, int x_right, int y_bottom,
|
||||
int x1, int y1, int x2, int y2, Uint32 draw_color, Uint8 * touched);
|
||||
|
|
|
|||
30
src/po/gl.po
30
src/po/gl.po
|
|
@ -12,7 +12,7 @@ msgstr ""
|
|||
"Project-Id-Version: Tux Paint\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-02-20 20:40-0800\n"
|
||||
"PO-Revision-Date: 2021-01-14 10:01+0100\n"
|
||||
"PO-Revision-Date: 2021-03-03 10:01+0100\n"
|
||||
"Last-Translator: Miguel Anxo Bouzada <mbouzada@gmail.com>\n"
|
||||
"Language-Team: Proxecto Trasno <proxecto@trasno.net>\n"
|
||||
"Language: gl\n"
|
||||
|
|
@ -187,40 +187,40 @@ msgstr "<9>spare-9b"
|
|||
|
||||
#: ../fill_tools.h:49
|
||||
msgid "Solid"
|
||||
msgstr ""
|
||||
msgstr "Sólida"
|
||||
|
||||
#: ../fill_tools.h:50
|
||||
#, fuzzy
|
||||
#| msgid "Lines"
|
||||
msgid "Linear"
|
||||
msgstr "Liñas"
|
||||
msgstr "Lineal"
|
||||
|
||||
#: ../fill_tools.h:51
|
||||
msgid "Radial"
|
||||
msgstr ""
|
||||
msgstr "Radial"
|
||||
|
||||
#: ../fill_tools.h:55
|
||||
#, fuzzy
|
||||
#| msgid "Click in the picture to fill that area with color."
|
||||
msgid "Click to fill an area with a solid color."
|
||||
msgstr "Preme no debuxo para encher unha área con cor."
|
||||
msgstr "Preme para encher unha área cunha cor sólida."
|
||||
|
||||
#: ../fill_tools.h:56
|
||||
msgid ""
|
||||
"Click and drag to fill an area with a linear gradient (from the chosen color "
|
||||
"to transparent)."
|
||||
msgstr ""
|
||||
"Preme e arrastra para encher unha área cun gradiente lineal (dende a cor "
|
||||
"escollida ata transparente)."
|
||||
|
||||
#: ../fill_tools.h:57
|
||||
msgid ""
|
||||
"Click to fill an area with a radial gradient (from the chosen color to "
|
||||
"transparent)."
|
||||
msgstr ""
|
||||
"Preme e arrastra para encher unha área cun gradiente radial (dende a cor "
|
||||
"escollida ata transparente)."
|
||||
|
||||
#. Congratulations #1
|
||||
#: ../great.h:37
|
||||
msgid "Great!"
|
||||
msgstr "Magnífico!"
|
||||
msgstr "Excelente!"
|
||||
|
||||
#. Congratulations #2
|
||||
#: ../great.h:40
|
||||
|
|
@ -421,10 +421,8 @@ msgstr "Maxia"
|
|||
|
||||
#. Title of fill selector (buttons down the right for fill tool)
|
||||
#: ../titles.h:81
|
||||
#, fuzzy
|
||||
#| msgid "Fill"
|
||||
msgid "Fills"
|
||||
msgstr "Encher"
|
||||
msgstr "Recheos"
|
||||
|
||||
#. Freehand painting tool
|
||||
#: ../tools.h:62
|
||||
|
|
@ -937,13 +935,11 @@ msgstr ""
|
|||
|
||||
#: ../../magic/src/checkerboard.c:99
|
||||
msgid "Checkerboard"
|
||||
msgstr ""
|
||||
msgstr "Taboleiro de xadrez"
|
||||
|
||||
#: ../../magic/src/checkerboard.c:106
|
||||
#, fuzzy
|
||||
#| msgid "Click and drag to draw repetitive patterns. "
|
||||
msgid "Click and drag to fill the canvas with a checkerboard pattern."
|
||||
msgstr "Preme e arrastra o rato para debuxar patróns repetitivos."
|
||||
msgstr "Preme e arrastra para encher o lenzo cun patrón xadrezado."
|
||||
|
||||
#: ../../magic/src/clone.c:132
|
||||
msgid "Clone"
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
Tux Paint - A simple drawing program for children.
|
||||
|
||||
Copyright (c) 2002-2020
|
||||
Copyright (c) 2002-2021
|
||||
by various contributors; see AUTHORS.txt
|
||||
http://www.tuxpaint.org/
|
||||
|
||||
|
|
@ -22,7 +22,7 @@
|
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
(See COPYING.txt)
|
||||
|
||||
June 14, 2002 - February 20, 2021
|
||||
June 14, 2002 - March 8, 2021
|
||||
*/
|
||||
|
||||
|
||||
|
|
@ -1936,7 +1936,7 @@ static unsigned cur_color;
|
|||
static int cur_tool, cur_brush, old_tool;
|
||||
static int cur_stamp[MAX_STAMP_GROUPS];
|
||||
static int cur_shape, cur_magic;
|
||||
static int cur_font, cur_eraser, cur_fill;
|
||||
static int cur_font, cur_eraser, cur_fill, fill_drag_started;
|
||||
static int cursor_left, cursor_x, cursor_y, cursor_textwidth; /* canvas-relative */
|
||||
static int old_cursor_x, old_cursor_y;
|
||||
static int cur_label, cur_select;
|
||||
|
|
@ -4792,6 +4792,8 @@ static void mainloop(void)
|
|||
if (would_flood_fill(canvas, draw_color, canv_color))
|
||||
{
|
||||
int x1, y1, x2, y2;
|
||||
SDL_Surface * last;
|
||||
int undo_ctr;
|
||||
|
||||
/* We only bother recording an undo buffer
|
||||
(which may kill our redos) if we're about
|
||||
|
|
@ -4799,30 +4801,38 @@ static void mainloop(void)
|
|||
rec_undo_buffer();
|
||||
x1 = x2 = old_x;
|
||||
y1 = y2 = old_y;
|
||||
|
||||
|
||||
if (cur_undo > 0)
|
||||
undo_ctr = cur_undo - 1;
|
||||
else
|
||||
undo_ctr = NUM_UNDO_BUFS - 1;
|
||||
|
||||
last = undo_bufs[undo_ctr];
|
||||
|
||||
|
||||
for (y1 = 0; y1 < canvas->h; y1++) {
|
||||
for (x1 = 0; x1 < canvas->w; x1++) {
|
||||
sim_flood_touched[(y1 * canvas->w) + x1] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (cur_fill == FILL_FLOOD)
|
||||
{
|
||||
/* Flood fill a solid color */
|
||||
do_flood_fill(canvas, old_x, old_y, draw_color, canv_color, &x1, &y1, &x2, &y2);
|
||||
|
||||
do_flood_fill(screen, last, canvas, old_x, old_y, draw_color, canv_color, &x1, &y1, &x2, &y2, sim_flood_touched);
|
||||
|
||||
update_canvas(x1, y1, x2, y2);
|
||||
}
|
||||
else
|
||||
{
|
||||
SDL_Surface * tmp_canvas;
|
||||
|
||||
for (y1 = 0; y1 < canvas->h; y1++) {
|
||||
for (x1 = 0; x1 < canvas->w; x1++) {
|
||||
sim_flood_touched[(y1 * canvas->w) + x1] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
tmp_canvas = SDL_CreateRGBSurface(canvas->flags,
|
||||
canvas->w, canvas->h, canvas->format->BitsPerPixel,
|
||||
canvas->format->Rmask, canvas->format->Gmask, canvas->format->Bmask, canvas->format->Amask);
|
||||
SDL_BlitSurface(canvas, NULL, tmp_canvas, NULL);
|
||||
|
||||
simulate_flood_fill(tmp_canvas, old_x, old_y, draw_color, canv_color, &x1, &y1, &x2, &y2, sim_flood_touched);
|
||||
simulate_flood_fill(screen, last, tmp_canvas, old_x, old_y, draw_color, canv_color, &x1, &y1, &x2, &y2, sim_flood_touched);
|
||||
SDL_FreeSurface(tmp_canvas);
|
||||
|
||||
sim_flood_x1 = x1;
|
||||
|
|
@ -4841,10 +4851,13 @@ static void mainloop(void)
|
|||
/* Start a linear gradient */
|
||||
draw_linear_gradient(canvas, canvas, sim_flood_x1, sim_flood_y1, sim_flood_x2, sim_flood_y2,
|
||||
fill_x, fill_y, old_x, old_y + 1, draw_color, sim_flood_touched);
|
||||
fill_drag_started = 1;
|
||||
}
|
||||
|
||||
update_canvas(x1, y1, x2, y2);
|
||||
}
|
||||
|
||||
draw_tux_text(TUX_GREAT, tool_tips[TOOL_FILL], 1);
|
||||
}
|
||||
}
|
||||
else if (cur_tool == TOOL_TEXT || cur_tool == TOOL_LABEL)
|
||||
|
|
@ -4995,7 +5008,6 @@ static void mainloop(void)
|
|||
}
|
||||
|
||||
do_render_cur_text(0);
|
||||
|
||||
}
|
||||
|
||||
button_down = 1;
|
||||
|
|
@ -5502,6 +5514,10 @@ static void mainloop(void)
|
|||
SDL_StartTextInput();
|
||||
}
|
||||
}
|
||||
else if (cur_tool == TOOL_FILL)
|
||||
{
|
||||
fill_drag_started = 0;
|
||||
}
|
||||
}
|
||||
button_down = 0;
|
||||
|
||||
|
|
@ -5822,7 +5838,7 @@ static void mainloop(void)
|
|||
sz = calc_eraser_size(cur_eraser);
|
||||
rect_xor(new_x - sz / 2, new_y - sz / 2, new_x + sz / 2, new_y + sz / 2);
|
||||
}
|
||||
else if (cur_tool == TOOL_FILL && cur_fill == FILL_GRADIENT_LINEAR)
|
||||
else if (cur_tool == TOOL_FILL && cur_fill == FILL_GRADIENT_LINEAR && fill_drag_started)
|
||||
{
|
||||
Uint32 draw_color, canv_color;
|
||||
int undo_ctr;
|
||||
|
|
@ -25386,7 +25402,7 @@ static void setup(void)
|
|||
printf("%s\n", tmp_str);
|
||||
#endif
|
||||
|
||||
safe_snprintf(tmp_str, sizeof(tmp_str), "© 2002–2020 Bill Kendrick et al.");
|
||||
safe_snprintf(tmp_str, sizeof(tmp_str), "© 2002–2021 Bill Kendrick et al.");
|
||||
tmp_surf = render_text(medium_font, tmp_str, black);
|
||||
dest.x = 10;
|
||||
dest.y = WINDOW_HEIGHT - img_progress->h - (tmp_surf->h * 2);
|
||||
|
|
@ -26020,6 +26036,8 @@ static void claim_to_be_ready(void)
|
|||
cur_magic = 0;
|
||||
cur_font = 0;
|
||||
cur_eraser = 0;
|
||||
cur_fill = 0;
|
||||
fill_drag_started = 0;
|
||||
cur_label = LABEL_LABEL;
|
||||
cur_select = 0;
|
||||
cursor_left = -1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue