Commit Graph

51041 Commits

Author SHA1 Message Date
Shubham 5c2373a125 app: Cancel functionality works with dynamic layers
Canceling a paint stroke restores the layer and mask (if present) to the
original size if they were expanded during the stroke. The part of
stroke that is outside the layer remains visible though.
2023-11-25 16:19:43 +00:00
Shubham d49fcf9495 app: Always separate blobs_to_render and last_blobs in ink tool
In ink tool, if last_blobs is empty, the copy of blobs present in
last_blobs and blobs_to_render was same. Due to this, when layer
boundary is expanded, we move same blobs twice. Due to this a straight
line was drawn when starting painting from outside layer boundary. Fixed
the issue by storing a duplicate version in blobs_to_render. Updated
free part accordingly.
2023-11-25 16:19:43 +00:00
Shubham 2a41fc7ee4 app: Blink lock when layer expansion is prevented by lock
In layer expansion if user is trying to draw outside the layer boundary
with expand option turned on but the "Lock position and size" enabled,
the lock square will be blinked. If user is painting on layer mask, the
corresponding layer's lock will be blinked. It will be blinked only
once per stroke.
2023-11-25 16:19:43 +00:00
Shubham df9d1f54f8 app: Fix inefficient method of preventing pushing undo
When resizing drawable for dynamic layers, the resize drawable function
would push Modified Layer/Channel item to undo stack. Initially, I was
checking if the drawable is being painted upon and used it to disable
the undo, but this when using resizing layers with layer mask, even if
mask is being painted upon, we still want to resize the main layer and
vice versa. But the main layer is not being painted upon so it would
push the undo to stack. To prevent this, I was using
gimp_drawable_paint_start before resizing, but this method is very
inefficient, as this function duplicates buffers. So added a new member
to drawable->private that will store weather to push undo or not.
2023-11-25 16:19:43 +00:00
Shubham 6bfed5008f app: Add options to choose fill type of layer and mask when expanding
Added option to tool settings that will decide how newly created parts
of layer and layer mask should be filled. For layer, same options are
provided as present in "Set Layer Boundary Size" dialog. For layer mask,
first two options from "Add a Mask to the Layer" i.e. "White" and
"Black" are added.

This commit changes gimp_channel_resize function to actually use the
passed fill type instead of using hardcoded GIMP_FILL_TRANSPARENT.
Hardcoding this value if required should be done in function calling
this function (which is already the case with all the instances already
present afaik).
2023-11-25 16:19:43 +00:00
Shubham 8bfa22b663 app: gimp_gegl_buffer_resize function can accept pattern to fill buffer
Modified gimp_gegl_buffer_resize function to add three new parameters,
pattern, pattern_offset_x and pattern_offset_y. If pattern is not NULL,
then we set the pattern of buffet to this value. Like in
gimp_gegl_buffer_resize function, this logic is mostly copied from
gimp_drawable_fill_buffer function with minor changes.
2023-11-25 16:19:43 +00:00
Shubham 841a195bb5 app: Fix broken strokes with the ink tool 2023-11-25 16:19:43 +00:00
Shubham 9ccb027aaa app: Create gimp_gegl_buffer_resize function
This function returns resized version of the input buffer. It also takes
in a color argument. The layer background will be filled with this
color. Fill background logic is similar to gimp_drawable_fill_buffer.
2023-11-25 16:19:43 +00:00
Shubham 5ed04055f1 app: check for lock_position of layer when editing its mask
The lock in the layers tab only sets lock for the actual layer and not
for its mask, so also check the lock on the actual layer and not just on
the mask when editing layer mask.
2023-11-25 16:19:43 +00:00
Shubham 5b8f410342 app: Fix layer expansion using MyPaint Brush tool with symmetry enabled 2023-11-25 16:19:43 +00:00
Shubham 960eaf0bc9 app: Ensure undo everytime layer expands while painting
Everytime the layer expands, if the undo extents are empty, then make
them non zero. If the undo extents are zero, then user will not be able
to undo the expansion of the layer. This is perticularly required by
MyPaintBrush as just clicking the image without any motion does not draw
anything, but expands layer if required.
2023-11-25 16:19:43 +00:00
Shubham b291a32a24 app: Layer expansion with MyPaintBrush now works.
Added tool option like other tools.
2023-11-25 16:19:43 +00:00
Shubham 5fdee7c5e7 app: gimp_paint_core_expand_drawable will return boolean
This function returns TRUE if the drawable is expanded. Otherwise, it
will return FALSE. This removes the need to check width and height of
the drawable to infer the same.
2023-11-25 16:19:43 +00:00
Shubham 95f795008f app: Make image flush related functions idle
Made `gimp_image_editor_image_flush` and
`gimp_image_editor_image_flush_idle` functions idle. For expanding
layers dynamically, we need to use gimp_image_flush funtion from the
paint therad. The gimp_image_flush eventually calls these functions.
2023-11-25 16:19:43 +00:00
Shubham 3ccec0b128 app: Layer expansion while painting now works with layers with mask
When painting the layers with a layer mask, if the layer need to be
expanded, the layer mask is also expanded with it. The same is done even
if layer mask is being painted upon.

Undo works with these layers by adding resizing of both the layer and
mask to the undo group if the layer is resized during painting.
2023-11-25 16:19:43 +00:00
Shubham 5191c17fb7 app: Fix layer expansion while painting with symmetry enabled 2023-11-25 16:19:43 +00:00
Shubham e33618a650 app: Layer expansion while using ink tool
Now layers will expand when trying to draw beyond layer borders with ink tool.
Tool options similar to paint tools have been added (expand_use and
expand_amount).
2023-11-25 16:19:43 +00:00
Shubham 97a2627867 app: Do not expand beyond image borders while painting
When painting with "Expand Layers" option turned on but "show all"
turned off, layer will not expand beyond image borders.

Layer will not expand if "Lock size and postion" is turned on.
2023-11-25 16:19:43 +00:00
Shubham 4a953e5b59 app: Separate function for layer expansion while painting
Created a separate function gimp_paint_core_expand_drawable that handles
layer expansion while painting. The gimp_brush_core_get_buffer function
now uses this function to expand drawable. It has been separated so that
it can be reused for ink tool.
2023-11-25 16:19:43 +00:00
Shubham 9707a87488 app: Add options for tools which make layers expand
Added a checkbox that decides weather tool should expand layer when
crossing layer border and a scale that decides by what amount should
layer expand.
2023-11-25 16:19:43 +00:00
Shubham becb23c926 app: Make undo work when layers are expanded during painting
Undo now restores layer to original size if it was expanded while
painting.
2023-11-25 16:19:43 +00:00
Shubham ae7d37ebbd app: Make layers expand when painting with paintbrush tool
When painting with paintbrush tool, the borders of active layer will
automatically expand to accomodate the stroke. The undo does not work
with expanding layers.
2023-11-25 16:19:43 +00:00
Rodrigo Lledó 7201858d65 Update Spanish translation 2023-11-24 12:06:17 +00:00
Rodrigo Lledó 0fbab7f784 Update Spanish translation 2023-11-24 10:25:47 +00:00
Rodrigo Lledó 4510a830b0 Update Spanish translation 2023-11-24 09:19:11 +00:00
Alx Sa 62da36cd43 core: Better handle group endings in ASE palette import
This patch adds better handling for group begin and end markers
within ASE palettes. As a result, this fixes an issue where the last
color was not imported in some ASE files without groups.
Additionally, this guarantees that colors are imported using 4 bytes
per https://gitlab.gnome.org/GNOME/gimp/-/issues/10359#note_1921462
2023-11-24 06:08:09 +00:00
Vasil Pupkin 95d062d774 Update Belarusian translation 2023-11-23 23:46:28 +00:00
Sabri Ünal 333f1e1e5b Update Turkish translation 2023-11-23 17:08:40 +00:00
Anders Jonsson 7291a3553c Update Swedish translation 2023-11-23 14:52:23 +00:00
Martin a8d589ec62 Update Slovenian translation 2023-11-23 08:07:19 +00:00
Ekaterine Papava 5794919aeb Update Georgian translation 2023-11-23 05:05:43 +00:00
Luming Zh a5bace3513 Update Chinese (China) translation 2023-11-21 21:15:22 +00:00
Jehan 217fd3699f NEWS: update. 2023-11-21 14:28:57 +01:00
Yuri Chornoivan f273cc93d4 Update Ukrainian translation 2023-11-21 07:11:17 +00:00
Daniel Novomeský 291208f4f9 build: associate hej2 extension in Windows installer 2023-11-20 20:18:37 +01:00
Daniel Novomeský 8bb34ac596 plug-ins: HEJ2 format loading
This image format is also called as JPEG-2000 in HEIF,
it is supported in recent versions of libheif.
Specification: https://www.itu.int/rec/T-REC-T.815-202106-I/en
2023-11-20 20:16:01 +01:00
Alx Sa 2c68021b54 core: Fix strict-aliasing error on ASE load
Resolves #10359

When compiled with -Werror=strict-aliasing, the build fails
on this line due to converting pointer datatypes.
This patch switches to using memcpy () instead.
2023-11-19 13:53:18 +00:00
Jordi Mas ef65db052f Update Catalan translation 2023-11-19 09:53:17 +01:00
Alx Sa b907e5efbe plug-ins: Import/export safe-to-copy PNG chunks
Currently we only use and retain "critical" PNG chunks,
discarding any safe-to-copy but non-image chunks.
This adds code to store them as parasites and then
include them on export, thus preventing loss of data.
2023-11-19 04:13:39 +00:00
Alx Sa 5e076c2803 plug-ins: Add loop count to GIF parasite
In ccd12318, the parasite to remember if the GIF was an animation
did not actually store the number of loops. This patch fixes that.
2023-11-17 21:07:05 +00:00
Martin 27e13924ea Update Slovenian translation 2023-11-17 09:29:14 +00:00
Jacob Boerema 10492830a8 plug-ins: fix GError set over the top of a previous GError ...
when loading a BMP image with an invalid compression value.

The invalid compression check was missing a goto out (error exit)
causing the GError to be overwritten, which caused a GLib warning.
We add the missing goto statement here.
2023-11-16 19:12:48 -05:00
Bruno Lopes fd6d404698 Issue #8877: Package 'gdbus' on Windows to fix warnings 2023-11-14 08:19:49 -03:00
Martin 3bdeeb9739 Update Slovenian translation 2023-11-13 14:39:32 +00:00
Martin bf381d7ad5 Update Slovenian translation 2023-11-13 14:27:35 +00:00
Luming Zh 104f4e272d Update Chinese (China) translation 2023-11-12 14:44:18 +00:00
Alx Sa ccd1231869 plug-ins: Save GIF animation when overwriting
Overwriting a GIF animation results in loss of frames if a previous export turned off
animations.
This sets a parasite on import which we check for on overwrite. If it was an
animation originally, we overwrite as an animation as well.
2023-11-12 12:10:34 +00:00
Luming Zh 7efd6421ba Update Chinese (China) translation 2023-11-12 00:57:22 +00:00
Ekaterine Papava 89df8aab1d Update Georgian translation 2023-11-11 20:07:23 +00:00
Jehan 24b36379f0 app: migrate shortcut from select-float to select-cut-float.
See my previous commit.
2023-11-11 20:03:26 +01:00