RSS/Atom feed Twitter
Site is read-only, email is disabled

Rotation-Tool: center point and grid

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

3 of 3 messages available
Toggle history

Please log in to manage your subscriptions.

Rotation-Tool: center point and grid oliver@first.in-berlin.de 28 Jun 15:40
  Rotation-Tool: center point and grid LightningIsMyName 28 Jun 16:08
   Rotation-Tool: center point and grid oliver@first.in-berlin.de 28 Jun 21:53
oliver@first.in-berlin.de
2010-06-28 15:40:26 UTC (over 14 years ago)

Rotation-Tool: center point and grid

Hello,

when using the rotate tool, I can enable a grid that is shown.

I also can move the center point.

What I want to have, is, that the center point's center also is at one crossover of grid lines.

Where (which file) can I change that?

Would that also be a feature that would be picked up into the regular source tree? I would like to have such a feature inside my regularly installed gimp.

Ciao, Oliver

LightningIsMyName
2010-06-28 16:08:29 UTC (over 14 years ago)

Rotation-Tool: center point and grid

Hello Oliver,

On Mon, Jun 28, 2010 at 4:40 PM, wrote:

when using the rotate tool, I can enable a grid that is shown.

I also can move the center point.

What I want to have, is, that the center point's center also is at one crossover of grid lines.

Where (which file) can I change that?

I'm not sure I understood correctly what do you wish to do. If I understood correctly, when you rotate a drawable, you can use the option "Preview: Image + Grid". Now, you would like to move the center of the rotation so that it will snap to this grid.

If this indeed what you mean, then you'll have to modify (at least) the following files:
app/tools/gimptransformtool.c - The base class for the transformation tools in GIMP (rotate, shear, transform, scale). The code of the grid for the transformation tool is there, and this is where you should look for information about the grid points (try looking at the function which actually draws the preview grid - it shows how to find and access the grid points themselves) app/tools/gimprotatetool.c - The code of the rotate tool

An interesting note which you should probably consider during your implementation, is that it's weird to snap the center of the rotation after you started rotating. Why? Because moving the center point will move the drawable (and the grid itself) and so after you move the center to some other location which was supposedly a crossover of the lines, the crossover would also move and it will probably not be there... (Try it - move the center of the rotation after you already rotated in some big angle)

Hope this helps =) LightningIsMyName

oliver@first.in-berlin.de
2010-06-28 21:53:28 UTC (over 14 years ago)

Rotation-Tool: center point and grid

Hello,

On Mon, Jun 28, 2010 at 05:08:29PM +0300, LightningIsMyName wrote:

Hello Oliver,

On Mon, Jun 28, 2010 at 4:40 PM, wrote:

when using the rotate tool, I can enable a grid that is shown.

I also can move the center point.

What I want to have, is, that the center point's center also is at one crossover of grid lines.

Where (which file) can I change that?

I'm not sure I understood correctly what do you wish to do. If I understood correctly, when you rotate a drawable, you can use the option "Preview: Image + Grid". Now, you would like to move the center of the rotation so that it will snap to this grid.

[...]

The other way around. I want the grid staying snapped on the center.

When I start the rotation tool, the center point and one cross of the grid are at the same location.

When I move the center point to some other place, the formerly centered cross of the grid does not follow the center point.

When I move the center point to e.g. the lower side of the edge of a building, if the cross would stay at the center point, I could then rotate as long as the grid goes along the edge of the building.

At the moment, this is not the case, and so it becomes tricky to find out, if the rotation has aligned the picture to the frame of the picture.

So I need to add more and more grid lines, so that comparing is easier. But just one grid line would be enough, if the grid is centered in the center point.

Even a single cross would be enough then, and a grid not necessary. (But it's good to have it, to compare with other parts of the picture).

If this indeed what you mean, then you'll have to modify (at least) the following files:
app/tools/gimptransformtool.c - The base class for the transformation tools in GIMP (rotate, shear, transform, scale). The code of the grid for the transformation tool is there, and this is where you should look for information about the grid points (try looking at the function which actually draws the preview grid - it shows how to find and access the grid points themselves) app/tools/gimprotatetool.c - The code of the rotate tool

[...]

OK, thank you.

Ciao, Oliver