GNOME Bugzilla – Bug 721376
"Layer Boundary Size" interface can be improved
Last modified: 2018-05-24 14:14:50 UTC
Layer/Layer to Boundary Size... does not appear to work as advertised. The offset appears to be relative to the original size of the layer, not the original size of the image. The panner image is limited to the size of the layer, not the image. When you first bring up the dialog, you are unable to reposition the layer unless you change the layer size to make the layer smaller. If you make the layer half the size of its original size and then click "Center", the offset is set to - 1/2 the size of the original image, not + 1/2, which seems bizarre. The layer is scaled properly, and ends up where you would expect (based on the center command given, but not based on the offsets indicated), but the values in the Offset boxes seem to have the wrong sign. It works by moving the original layer relative to the desired new layer, rather than position the new layer relative to the image. This means you can't move the layer relative to the image if the layer is smaller than the image, and the graphic panner doesn't show you the layer position relative to the image as a whole. It is not at all intuitive and is not useful for quite a few common cases.
This dialog has been presenting the new offset relative to the old layer's position and size since the beginning of time, and this is the first time I hear somebody asking for changing it to work relative to the image. I can see how relative to image can be useful, but the lack of any complaints whatsoever so far makes me think the current behavior is useful for many people too...
Maybe this could be changed for a feature request for a toggle to "show whole image area" on the preview area of this dialog? In which case, the offsets would be relative to the image, not to the new layer. (Changing the request to not break current behavior and make everyone happy does not mean necessarily it will be done, though)
After much playing with it, I think I understand it, and it's not quite as bad as I originally thought, although it isn't particular ly good. The documentation in the help is totally wrong, which is one reason why it is confusing. I suspect the tool seldom gets used. The most common operation for resizing a layer is to grow/shrink it to fit the image, and there is a Layer menu operation for that. The panner and the x and y offset are not used to position the layer relative to the image. They are used to describe where the existing layer contents will be placed relative to the new layer size. At least that is the way it functions currently. The outside of the panner represents the total size of the new layer. The part of the panner which you move represents the existing contents of the layer, and the offset is the offset of the upper left corner of the existing contents relative to the upper left corner of the new layer. That is why when the dialog first comes up it looks just like a box -- the new layer size is the same as the original layer size, and neither is larger than the other, *regardless of what the layer size is relative to the image* -- the image size is not shown in any way. An exercise to try to understand what it's doing: 1a. Create a 600 x 600 image, white background. b. Add a 300 x 300 layer, black background, origin 0,0 c. Activate layer to boundary size d. Notice the panner -- it is totally filled. That is because it represents the layer only. Problems with this presentation: It does not allow you to reposition the layer relative to the image (which is what the documentation says the x,y entries are for). You cannot change the X,Y parameters at all, because they actually are relative to the layer, and the new layer is the same size as the original at this point. Comment: It should allow you to reposition the contents anyway, to allow you to shift the contents in the layer without changing its size. e. Set the layer width to 500 Look at the panner. At this point, if you think about it a bit, you realize that the panner represents the layer only, and the outside boundary of the panner is the boundary of the new layer size. The old layer contents are positioned at (0,0) relative to the new layer origin. Increasing the X offset shifts the old contents to the right. You are only allowed to shift the layer contents within the new layer boundary, which is not necessarily the best behavior. You might want to shift it up or down as well, even though that would cause you to lose the part shifted out of bounds. f. Set the layer width to 200. Look at the panner. It's not at all obvious what it represents, until you try to move something. If you try to grab the white area, you can't move it. When you move any of the black area, it becomes clear that you are moving the original contents relative to the new size of the layer. But what is the rectangle in the middle of the panner? It's not just two vertical lines; it is a whole new rectangle, with a top and bottom as well as sides. It looks like it is supposed to represent a separate entity; I have no idea what it represents. The documentation says the resized layer is positioned at 0,0 relative to the old one, which it is not. The offset says (0,0), which makes no sense whatsoever in the panner diagram, unless you change the reference point / coordinate system to put (0,0) at the upper or lower right. If you set the new height to 200 the only (0,0) origin which makes sense is lower right; but that conflicts with the case when the boundary is grown (step e above). The left vertical line represents the left edge of the original layer contents; I have no idea what the right vertical line represents. g. Set the layer height to 200. Now there is a square showing in the middle. What does it represent? I think it is supposed to represent the portion of the original contents which will be shown in the resized / shrunken layer; but now what does the outside of the panner represent? It appears to be a somewhat arbitrary restriction to force you to lose the least amount of data from the portion of the layer which is retained, which again may not be what you want. If one wants to maintain the current behavior, then the current behavior needs to be properly defined, and the tool made to work that way, and the documentation made to match. But I think everything the current behavior does can also be done with a tool that is much more intuitive, by making it resize relative to the image. When changing the boundary of a layer, there are two things which need to be dealt with: 1. The position of the layer relative to the image. 2. The position of the old (existing) contents of the layer relative to the layer origin. That requires either: A. One offset pair and one panner, with a toggle for each of the items to be dealt with above; or B. two offset pairs and two panners, one set for each of the above; or C. two offset pairs and one fancy panner that allowed moving the old contents and the layer boundary separately. Any of those options would work fairly well, but A and B are probably easier to implement.
Let's convert this to an enhancement request for the UI then, and file a new bug against the help to improve that.
(In reply to comment #4) > and file a new bug against the help to improve that. That would be bug 722546.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gimp/issues/523.