Repository navigation
Find and keep layers inside layer groups - #169
Conversation
layer_name now searches the whole layer tree, so every tool that takes one finds layers inside groups. layer_index still counts top-level layers only, matching list_layers. Tools that place a layer next to an existing one now keep it in that layer's group: - reorder_layer moves a layer within its own group; new_position is its index there. Before, a grouped layer was moved out to the top level. - duplicate_layer puts the copy directly above the source, in its group. Before, the copy went to the top of the image. - apply_drop_shadow puts the shadow directly below the source, in its group. Before, it went to the top level, where it could cover the layer. duplicate_layer and apply_drop_shadow also report an error, and free the new layer, when GIMP refuses to insert it. Fixes #131.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 40 minutes. View limit details
No actionable comments were generated in the recent review. WalkthroughLayer-name lookup now traverses nested groups, while ChangesGrouped layer operations
Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix · Severity of issue fixed: Medium Possibly related issues
Possibly related PRs
Suggested reviewers: Merge Risk:
|
# Conflicts: # CHANGELOG.md
Fixes #131.
layer_namenow searches the whole layer tree, so the ~30 tools that take one find layers inside groups.layer_indexstill counts only top-level layers, matchinglist_layers.Tools that place a layer next to an existing one now keep it in that layer's group:
reorder_layermoves a layer within its own group, andnew_positionis its index there. Before, a grouped layer was moved out to the top level.duplicate_layerputs the copy directly above the source, in its group. Before, the copy went to the top of the image.apply_drop_shadowputs the shadow directly below the source, in its group. Before, it went to the top level, where it could cover the layer. Withlayer_namereaching grouped layers, this one became easy to hit.duplicate_layerandapply_drop_shadowalso return an error, and free the new layer, when GIMP refuses the insert.Tests
tests/test_grouped_layers.py(offline, 8 tests). It fails againstmain's plugin.tests/test_grouped_layers_live.py, on GIMP 3.2.8: name lookup two groups deep, reorder by name and of the selected layer, duplicate, drop shadow,layer_index, rename and delete.Not in this PR
list_layersandget_image_metadatastill list only top-level layers, so clients can't find out grouped layers' names yet. That will be a separate issue.layer_indexstill counts only top-level layers, so it keeps matching the indexeslist_layersreports. That's a decision for now: whether grouped layers should get an index too will be decided in the same follow-up as listing them.Summary by CodeRabbit