mirror of https://github.com/GNOME/gimp.git
app: take transform-grid handle size into account when readjusting
In the unified-transform, scale, and perspective tools, take the maximal transform-grid handle size into account when readjusting the transform, so that the handles themselves are fully within view under arbitrary rotation, rather than just the corners.
This commit is contained in:
parent
f6bfc2f23b
commit
46e16e175c
|
@ -22,9 +22,14 @@
|
|||
#define __GIMP_TOOL_TRANSFORM_GRID_H__
|
||||
|
||||
|
||||
#include "gimpcanvashandle.h"
|
||||
#include "gimptoolwidget.h"
|
||||
|
||||
|
||||
#define GIMP_TOOL_TRANSFORM_GRID_MAX_HANDLE_SIZE \
|
||||
(1.5 * GIMP_CANVAS_HANDLE_SIZE_LARGE)
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GIMP_TRANSFORM_HANDLE_NONE,
|
||||
|
|
|
@ -176,7 +176,9 @@ gimp_perspective_tool_readjust (GimpTransformGridTool *tg_tool)
|
|||
|
||||
x = shell->disp_width / 2.0;
|
||||
y = shell->disp_height / 2.0;
|
||||
r = MIN (x, y) / G_SQRT2;
|
||||
r = MAX (MIN (x, y) / G_SQRT2 -
|
||||
GIMP_TOOL_TRANSFORM_GRID_MAX_HANDLE_SIZE / 2.0,
|
||||
GIMP_TOOL_TRANSFORM_GRID_MAX_HANDLE_SIZE / 2.0);
|
||||
|
||||
gimp_display_shell_untransform_xy_f (shell,
|
||||
x - r, y - r,
|
||||
|
|
|
@ -268,7 +268,9 @@ gimp_scale_tool_readjust (GimpTransformGridTool *tg_tool)
|
|||
|
||||
x = shell->disp_width / 2.0;
|
||||
y = shell->disp_height / 2.0;
|
||||
r = MIN (x, y) / G_SQRT2;
|
||||
r = MAX (MIN (x, y) / G_SQRT2 -
|
||||
GIMP_TOOL_TRANSFORM_GRID_MAX_HANDLE_SIZE / 2.0,
|
||||
GIMP_TOOL_TRANSFORM_GRID_MAX_HANDLE_SIZE / 2.0);
|
||||
|
||||
gimp_display_shell_untransform_xy_f (shell,
|
||||
x, y,
|
||||
|
|
|
@ -188,7 +188,9 @@ gimp_unified_transform_tool_readjust (GimpTransformGridTool *tg_tool)
|
|||
|
||||
x = shell->disp_width / 2.0;
|
||||
y = shell->disp_height / 2.0;
|
||||
r = MIN (x, y) / G_SQRT2;
|
||||
r = MAX (MIN (x, y) / G_SQRT2 -
|
||||
GIMP_TOOL_TRANSFORM_GRID_MAX_HANDLE_SIZE / 2.0,
|
||||
GIMP_TOOL_TRANSFORM_GRID_MAX_HANDLE_SIZE / 2.0);
|
||||
|
||||
gimp_display_shell_untransform_xy_f (shell,
|
||||
x, y,
|
||||
|
|
Loading…
Reference in New Issue