Fixed a mistake in the code which does a pattern clone. Closes bug
2003-07-19 Dave Neary <bolsh@gimp.org> * app/paint/gimpclone.c: Fixed a mistake in the code which does a pattern clone. Closes bug #117433. * app/widgets/gimpbrushfactoryview.c: Added a tooltip for the Spacing slider.
This commit is contained in:
parent
7b56d5efd7
commit
cfbde0f301
@ -1,3 +1,11 @@
|
|||||||
|
2003-07-19 Dave Neary <bolsh@gimp.org>
|
||||||
|
|
||||||
|
* app/paint/gimpclone.c: Fixed a mistake in the code which does
|
||||||
|
a pattern clone. Closes bug #117433.
|
||||||
|
|
||||||
|
* app/widgets/gimpbrushfactoryview.c: Added a tooltip for the
|
||||||
|
Spacing slider.
|
||||||
|
|
||||||
2003-07-19 Sven Neumann <sven@gimp.org>
|
2003-07-19 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
* libgimpwidgets/gimpcolornotebook.c: save some space by showing
|
* libgimpwidgets/gimpcolornotebook.c: save some space by showing
|
||||||
|
@ -504,8 +504,11 @@ gimp_clone_line_pattern (GimpImage *dest,
|
|||||||
guchar *pat, *p;
|
guchar *pat, *p;
|
||||||
GimpImageBaseType color_type;
|
GimpImageBaseType color_type;
|
||||||
gint alpha;
|
gint alpha;
|
||||||
|
gint pat_bytes;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
|
pat_bytes = pattern->mask->bytes;
|
||||||
|
|
||||||
/* Make sure x, y are positive */
|
/* Make sure x, y are positive */
|
||||||
while (x < 0)
|
while (x < 0)
|
||||||
x += pattern->mask->width;
|
x += pattern->mask->width;
|
||||||
@ -514,21 +517,21 @@ gimp_clone_line_pattern (GimpImage *dest,
|
|||||||
|
|
||||||
/* Get a pointer to the appropriate scanline of the pattern buffer */
|
/* Get a pointer to the appropriate scanline of the pattern buffer */
|
||||||
pat = temp_buf_data (pattern->mask) +
|
pat = temp_buf_data (pattern->mask) +
|
||||||
(y % pattern->mask->height) * pattern->mask->width * pattern->mask->bytes;
|
(y % pattern->mask->height) * pattern->mask->width * pat_bytes;
|
||||||
|
|
||||||
color_type = (pattern->mask->bytes == 3 ||
|
color_type = (pat_bytes == 3 ||
|
||||||
pattern->mask->bytes == 4) ? GIMP_RGB : GIMP_GRAY;
|
pat_bytes == 4) ? GIMP_RGB : GIMP_GRAY;
|
||||||
|
|
||||||
alpha = bytes - 1;
|
alpha = bytes - 1;
|
||||||
|
|
||||||
for (i = 0; i < width; i++)
|
for (i = 0; i < width; i++)
|
||||||
{
|
{
|
||||||
p = pat + ((i + x) % pattern->mask->width) * pattern->mask->bytes;
|
p = pat + ((i + x) % pattern->mask->width) * pat_bytes;
|
||||||
|
|
||||||
gimp_image_transform_color (dest, drawable, p, d, color_type);
|
gimp_image_transform_color (dest, drawable, p, d, color_type);
|
||||||
|
|
||||||
if (pattern->mask->bytes == 2 || pattern->mask->bytes == 4)
|
if (pat_bytes == 2 || pat_bytes == 4)
|
||||||
d[alpha] = p[alpha];
|
d[alpha] = p[pat_bytes - 1];
|
||||||
else
|
else
|
||||||
d[alpha] = OPAQUE_OPACITY;
|
d[alpha] = OPAQUE_OPACITY;
|
||||||
|
|
||||||
|
@ -504,8 +504,11 @@ gimp_clone_line_pattern (GimpImage *dest,
|
|||||||
guchar *pat, *p;
|
guchar *pat, *p;
|
||||||
GimpImageBaseType color_type;
|
GimpImageBaseType color_type;
|
||||||
gint alpha;
|
gint alpha;
|
||||||
|
gint pat_bytes;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
|
pat_bytes = pattern->mask->bytes;
|
||||||
|
|
||||||
/* Make sure x, y are positive */
|
/* Make sure x, y are positive */
|
||||||
while (x < 0)
|
while (x < 0)
|
||||||
x += pattern->mask->width;
|
x += pattern->mask->width;
|
||||||
@ -514,21 +517,21 @@ gimp_clone_line_pattern (GimpImage *dest,
|
|||||||
|
|
||||||
/* Get a pointer to the appropriate scanline of the pattern buffer */
|
/* Get a pointer to the appropriate scanline of the pattern buffer */
|
||||||
pat = temp_buf_data (pattern->mask) +
|
pat = temp_buf_data (pattern->mask) +
|
||||||
(y % pattern->mask->height) * pattern->mask->width * pattern->mask->bytes;
|
(y % pattern->mask->height) * pattern->mask->width * pat_bytes;
|
||||||
|
|
||||||
color_type = (pattern->mask->bytes == 3 ||
|
color_type = (pat_bytes == 3 ||
|
||||||
pattern->mask->bytes == 4) ? GIMP_RGB : GIMP_GRAY;
|
pat_bytes == 4) ? GIMP_RGB : GIMP_GRAY;
|
||||||
|
|
||||||
alpha = bytes - 1;
|
alpha = bytes - 1;
|
||||||
|
|
||||||
for (i = 0; i < width; i++)
|
for (i = 0; i < width; i++)
|
||||||
{
|
{
|
||||||
p = pat + ((i + x) % pattern->mask->width) * pattern->mask->bytes;
|
p = pat + ((i + x) % pattern->mask->width) * pat_bytes;
|
||||||
|
|
||||||
gimp_image_transform_color (dest, drawable, p, d, color_type);
|
gimp_image_transform_color (dest, drawable, p, d, color_type);
|
||||||
|
|
||||||
if (pattern->mask->bytes == 2 || pattern->mask->bytes == 4)
|
if (pat_bytes == 2 || pat_bytes == 4)
|
||||||
d[alpha] = p[alpha];
|
d[alpha] = p[pat_bytes - 1];
|
||||||
else
|
else
|
||||||
d[alpha] = OPAQUE_OPACITY;
|
d[alpha] = OPAQUE_OPACITY;
|
||||||
|
|
||||||
|
@ -115,7 +115,8 @@ gimp_brush_factory_view_init (GimpBrushFactoryView *view)
|
|||||||
_("Spacing:"), -1, -1,
|
_("Spacing:"), -1, -1,
|
||||||
0.0, 1.0, 1000.0, 1.0, 10.0, 1,
|
0.0, 1.0, 1000.0, 1.0, 10.0, 1,
|
||||||
TRUE, 0.0, 0.0,
|
TRUE, 0.0, 0.0,
|
||||||
NULL, NULL));
|
_("Percentage of width of brush"),
|
||||||
|
NULL));
|
||||||
|
|
||||||
view->spacing_scale = GIMP_SCALE_ENTRY_SCALE (view->spacing_adjustment);
|
view->spacing_scale = GIMP_SCALE_ENTRY_SCALE (view->spacing_adjustment);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user