[gimp/gimp-2-10] app: take transform-grid handle size into account when readjusting
- From: Ell <ell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gimp-2-10] app: take transform-grid handle size into account when readjusting
- Date: Fri, 8 Mar 2019 17:11:42 +0000 (UTC)
commit 1ecbb94b2cedcb154b762e4ab36d411cfe8a7c1f
Author: Ell <ell_se yahoo com>
Date: Fri Mar 8 08:30:11 2019 -0500
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.
(cherry picked from commit 46e16e175c4cdc9da715ec50a8b793ea9688525d)
app/display/gimptooltransformgrid.h | 5 +++++
app/tools/gimpperspectivetool.c | 4 +++-
app/tools/gimpscaletool.c | 4 +++-
app/tools/gimpunifiedtransformtool.c | 4 +++-
4 files changed, 14 insertions(+), 3 deletions(-)
---
diff --git a/app/display/gimptooltransformgrid.h b/app/display/gimptooltransformgrid.h
index 7037c5a8c4..e42b9ed4ed 100644
--- a/app/display/gimptooltransformgrid.h
+++ b/app/display/gimptooltransformgrid.h
@@ -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,
diff --git a/app/tools/gimpperspectivetool.c b/app/tools/gimpperspectivetool.c
index 58d0e8983e..c6f7a5d98c 100644
--- a/app/tools/gimpperspectivetool.c
+++ b/app/tools/gimpperspectivetool.c
@@ -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,
diff --git a/app/tools/gimpscaletool.c b/app/tools/gimpscaletool.c
index c0486c4ee5..dacea95046 100644
--- a/app/tools/gimpscaletool.c
+++ b/app/tools/gimpscaletool.c
@@ -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,
diff --git a/app/tools/gimpunifiedtransformtool.c b/app/tools/gimpunifiedtransformtool.c
index ba474b50b3..9957f4ccb3 100644
--- a/app/tools/gimpunifiedtransformtool.c
+++ b/app/tools/gimpunifiedtransformtool.c
@@ -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,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]