-
Ell authored
... and fix flatten-image along the way. *And* do some cleanup. Currently, gimp_image_merge_layers() combines the layers on its own, one by one. This is incompatible with pass-through groups, because the group's buffer is rendered independently of its backdrop, while we need to take the backdrop into account when mergeing the group. Instead, render the subgraph of the parent graph, corresponding to the set of merged layers, directly into the new layer. Since the layers we merge are always visible and continuous, all we need is a minor massage to the parent graph to make it work. This takes care of pass-through groups intrinsicly. This commit also changes the behavior of flatten-image: Currently, the flattened layers are rendered directly on top of the opaque background, which can make previously-hidden areas (due to layers using composite modes other than src-over, or legacy layer modes) visible. This is almost certainly not desirable. Instead, construct the graph such that the flattened layers are combined with the background only after being merged with one another.
67fc418c