gimpmovetool.c 21.6 KB
Newer Older
1
/* GIMP - The GNU Image Manipulation Program
Elliot Lee's avatar
Elliot Lee committed
2 3
 * Copyright (C) 1995 Spencer Kimball and Peter Mattis
 *
4
 * This program is free software: you can redistribute it and/or modify
Elliot Lee's avatar
Elliot Lee committed
5
 * it under the terms of the GNU General Public License as published by
6
 * the Free Software Foundation; either version 3 of the License, or
Elliot Lee's avatar
Elliot Lee committed
7 8 9 10 11 12 13 14
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
15
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
Elliot Lee's avatar
Elliot Lee committed
16
 */
Sven Neumann's avatar
Sven Neumann committed
17 18 19

#include "config.h"

20 21
#include <string.h>

22
#include <gegl.h>
Sven Neumann's avatar
Sven Neumann committed
23 24
#include <gtk/gtk.h>

25
#include "libgimpmath/gimpmath.h"
Michael Natterer's avatar
Michael Natterer committed
26 27
#include "libgimpwidgets/gimpwidgets.h"

28
#include "tools-types.h"
29

Michael Natterer's avatar
Michael Natterer committed
30
#include "config/gimpdisplayconfig.h"
31
#include "config/gimpguiconfig.h"
32 33

#include "core/gimp.h"
Jehan's avatar
Jehan committed
34
#include "core/gimp-cairo.h"
35
#include "core/gimpguide.h"
36
#include "core/gimpimage.h"
37
#include "core/gimpimage-pick-item.h"
38
#include "core/gimplayer.h"
39
#include "core/gimpimage-undo.h"
40
#include "core/gimplayermask.h"
41
#include "core/gimplayer-floating-selection.h"
42
#include "core/gimpundostack.h"
43

44
#include "widgets/gimphelp-ids.h"
45
#include "widgets/gimpwidgets-utils.h"
46

47
#include "display/gimpcanvasitem.h"
48
#include "display/gimpdisplay.h"
Michael Natterer's avatar
Michael Natterer committed
49
#include "display/gimpdisplayshell.h"
50
#include "display/gimpdisplayshell-appearance.h"
Sven Neumann's avatar
Sven Neumann committed
51
#include "display/gimpdisplayshell-selection.h"
52
#include "display/gimpdisplayshell-transform.h"
53

54
#include "gimpeditselectiontool.h"
55
#include "gimpguidetool.h"
56
#include "gimpmoveoptions.h"
57
#include "gimpmovetool.h"
58
#include "gimptoolcontrol.h"
Elliot Lee's avatar
Elliot Lee committed
59

60
#include "gimp-intl.h"
61

62

63 64
/*  local function prototypes  */

65
static void   gimp_move_tool_button_press   (GimpTool              *tool,
66
                                             const GimpCoords      *coords,
67 68
                                             guint32                time,
                                             GdkModifierType        state,
69
                                             GimpButtonPressType    press_type,
70 71
                                             GimpDisplay           *display);
static void   gimp_move_tool_button_release (GimpTool              *tool,
72
                                             const GimpCoords      *coords,
73 74 75 76
                                             guint32                time,
                                             GdkModifierType        state,
                                             GimpButtonReleaseType  release_type,
                                             GimpDisplay           *display);
77 78 79
static gboolean gimp_move_tool_key_press    (GimpTool              *tool,
                                             GdkEventKey           *kevent,
                                             GimpDisplay           *display);
80 81 82 83 84 85
static void   gimp_move_tool_modifier_key   (GimpTool              *tool,
                                             GdkModifierType        key,
                                             gboolean               press,
                                             GdkModifierType        state,
                                             GimpDisplay           *display);
static void   gimp_move_tool_oper_update    (GimpTool              *tool,
86
                                             const GimpCoords      *coords,
87 88 89 90
                                             GdkModifierType        state,
                                             gboolean               proximity,
                                             GimpDisplay           *display);
static void   gimp_move_tool_cursor_update  (GimpTool              *tool,
91
                                             const GimpCoords      *coords,
92 93 94 95 96
                                             GdkModifierType        state,
                                             GimpDisplay           *display);

static void   gimp_move_tool_draw           (GimpDrawTool          *draw_tool);

97

98
G_DEFINE_TYPE (GimpMoveTool, gimp_move_tool, GIMP_TYPE_DRAW_TOOL)
99 100

#define parent_class gimp_move_tool_parent_class
101 102 103


void
Nate Summers's avatar
Nate Summers committed
104
gimp_move_tool_register (GimpToolRegisterCallback  callback,
105
                         gpointer                  data)
106
{
Nate Summers's avatar
Nate Summers committed
107
  (* callback) (GIMP_TYPE_MOVE_TOOL,
108 109
                GIMP_TYPE_MOVE_OPTIONS,
                gimp_move_options_gui,
110
                0,
111
                "gimp-move-tool",
112
                C_("tool", "Move"),
113
                _("Move Tool: Move layers, selections, and other objects"),
114
                N_("_Move"), "M",
115
                NULL, GIMP_HELP_TOOL_MOVE,
116
                GIMP_ICON_TOOL_MOVE,
117
                data);
118 119 120 121 122
}

static void
gimp_move_tool_class_init (GimpMoveToolClass *klass)
{
123 124
  GimpToolClass     *tool_class      = GIMP_TOOL_CLASS (klass);
  GimpDrawToolClass *draw_tool_class = GIMP_DRAW_TOOL_CLASS (klass);
125

126 127
  tool_class->button_press   = gimp_move_tool_button_press;
  tool_class->button_release = gimp_move_tool_button_release;
128
  tool_class->key_press      = gimp_move_tool_key_press;
129
  tool_class->modifier_key   = gimp_move_tool_modifier_key;
130
  tool_class->oper_update    = gimp_move_tool_oper_update;
131
  tool_class->cursor_update  = gimp_move_tool_cursor_update;
132 133

  draw_tool_class->draw      = gimp_move_tool_draw;
134 135 136 137 138
}

static void
gimp_move_tool_init (GimpMoveTool *move_tool)
{
Michael Natterer's avatar
Michael Natterer committed
139
  GimpTool *tool = GIMP_TOOL (move_tool);
140

141 142 143 144 145
  gimp_tool_control_set_snap_to            (tool->control, FALSE);
  gimp_tool_control_set_handle_empty_image (tool->control, TRUE);
  gimp_tool_control_set_tool_cursor        (tool->control,
                                            GIMP_TOOL_CURSOR_MOVE);

146 147
  move_tool->floating_layer     = NULL;
  move_tool->guide              = NULL;
148

149 150 151 152
  move_tool->saved_type         = GIMP_TRANSFORM_TYPE_LAYER;

  move_tool->old_active_layer   = NULL;
  move_tool->old_active_vectors = NULL;
153 154
}

Elliot Lee's avatar
Elliot Lee committed
155
static void
156 157 158 159 160 161
gimp_move_tool_button_press (GimpTool            *tool,
                             const GimpCoords    *coords,
                             guint32              time,
                             GdkModifierType      state,
                             GimpButtonPressType  press_type,
                             GimpDisplay         *display)
Elliot Lee's avatar
Elliot Lee committed
162
{
163 164 165 166 167 168 169
  GimpMoveTool     *move           = GIMP_MOVE_TOOL (tool);
  GimpMoveOptions  *options        = GIMP_MOVE_TOOL_GET_OPTIONS (tool);
  GimpDisplayShell *shell          = gimp_display_get_shell (display);
  GimpImage        *image          = gimp_display_get_image (display);
  GimpItem         *active_item    = NULL;
  const gchar      *null_message   = NULL;
  const gchar      *locked_message = NULL;
170

171
  tool->display = display;
172

173 174
  move->floating_layer     = NULL;
  move->guide              = NULL;
Elliot Lee's avatar
Elliot Lee committed
175

176
  if (! options->move_current)
Elliot Lee's avatar
Elliot Lee committed
177
    {
178 179
      const gint snap_distance = display->config->snap_distance;

180
      if (options->move_type == GIMP_TRANSFORM_TYPE_PATH)
181 182 183
        {
          GimpVectors *vectors;

184 185 186 187
          vectors = gimp_image_pick_vectors (image,
                                             coords->x, coords->y,
                                             FUNSCALEX (shell, snap_distance),
                                             FUNSCALEY (shell, snap_distance));
188
          if (vectors)
189
            {
190
              move->old_active_vectors =
191
                gimp_image_get_active_vectors (image);
192

193
              gimp_image_set_active_vectors (image, vectors);
194
            }
195
          else
196 197 198 199
            {
              /*  no path picked  */
              return;
            }
200
        }
201 202
      else if (options->move_type == GIMP_TRANSFORM_TYPE_LAYER)
        {
203 204
          GimpGuide  *guide;
          GimpLayer  *layer;
205 206

          if (gimp_display_shell_get_show_guides (shell) &&
207
              (guide = gimp_image_pick_guide (image,
208 209 210 211
                                              coords->x, coords->y,
                                              FUNSCALEX (shell, snap_distance),
                                              FUNSCALEY (shell, snap_distance))))
            {
212
              move->guide = guide;
213

214
              gimp_guide_tool_start_edit (tool, display, guide);
215

216 217
              return;
            }
218
          else if ((layer = gimp_image_pick_layer (image,
219 220
                                                   coords->x,
                                                   coords->y)))
221
            {
222
              if (gimp_image_get_floating_selection (image) &&
223 224 225 226 227
                  ! gimp_layer_is_floating_sel (layer))
                {
                  /*  If there is a floating selection, and this aint it,
                   *  use the move tool to anchor it.
                   */
228
                  move->floating_layer =
229
                    gimp_image_get_floating_selection (image);
230

231
                  gimp_tool_control_activate (tool->control);
232

233 234 235 236
                  return;
                }
              else
                {
237
                  move->old_active_layer = gimp_image_get_active_layer (image);
238

239
                  gimp_image_set_active_layer (image, layer);
240 241 242 243 244
                }
            }
          else
            {
              /*  no guide and no layer picked  */
245

246 247 248 249
              return;
            }
        }
    }
250

251 252 253
  switch (options->move_type)
    {
    case GIMP_TRANSFORM_TYPE_PATH:
254 255 256 257 258 259 260 261 262 263 264 265 266 267
      {
        active_item    = GIMP_ITEM (gimp_image_get_active_vectors (image));
        null_message   = _("There is no path to move.");
        locked_message = _("The active path's position is locked.");

        if (active_item && ! gimp_item_is_position_locked (active_item))
          {
            gimp_tool_control_activate (tool->control);
            gimp_edit_selection_tool_start (tool, display, coords,
                                            GIMP_TRANSLATE_MODE_VECTORS,
                                            TRUE);
            return;
          }
      }
268
      break;
269

270
    case GIMP_TRANSFORM_TYPE_SELECTION:
271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290
      {
        active_item    = GIMP_ITEM (gimp_image_get_mask (image));
        /* cannot happen, so don't translate these messages */
        null_message   = "There is no selection to move.";
        locked_message = "The selection's position is locked.";

        if (active_item && ! gimp_item_is_position_locked (active_item))
          {
            if (! gimp_channel_is_empty (gimp_image_get_mask (image)))
              {
                gimp_tool_control_activate (tool->control);
                gimp_edit_selection_tool_start (tool, display, coords,
                                                GIMP_TRANSLATE_MODE_MASK,
                                                TRUE);
                return;
              }
            else
              locked_message = _("The selection is empty.");
          }
      }
291
      break;
292

293 294
    case GIMP_TRANSFORM_TYPE_LAYER:
      {
295 296
        active_item  = GIMP_ITEM (gimp_image_get_active_drawable (image));
        null_message = _("There is no layer to move.");
297

298
        if (GIMP_IS_LAYER_MASK (active_item))
299
          {
300 301 302 303 304 305 306 307 308 309
            locked_message = _("The active layer's position is locked.");

            if (! gimp_item_is_position_locked (active_item))
              {
                gimp_tool_control_activate (tool->control);
                gimp_edit_selection_tool_start (tool, display, coords,
                                                GIMP_TRANSLATE_MODE_LAYER_MASK,
                                                TRUE);
                return;
              }
310
          }
311
        else if (GIMP_IS_CHANNEL (active_item))
312
          {
313 314 315 316 317 318 319 320 321 322
            locked_message = _("The active channel's position is locked.");

            if (! gimp_item_is_position_locked (active_item))
              {
                gimp_tool_control_activate (tool->control);
                gimp_edit_selection_tool_start (tool, display, coords,
                                                GIMP_TRANSLATE_MODE_CHANNEL,
                                                TRUE);
                return;
              }
323
          }
324
        else if (GIMP_IS_LAYER (active_item))
325
          {
326 327 328 329 330 331 332 333 334 335
            locked_message = _("The active layer's position is locked.");

            if (! gimp_item_is_position_locked (active_item))
              {
                gimp_tool_control_activate (tool->control);
                gimp_edit_selection_tool_start (tool, display, coords,
                                                GIMP_TRANSLATE_MODE_LAYER,
                                                TRUE);
                return;
              }
336
          }
337 338
      }
      break;
Elliot Lee's avatar
Elliot Lee committed
339
    }
340 341 342 343 344 345 346 347 348 349 350

  if (! active_item)
    {
      gimp_tool_message_literal (tool, display, null_message);
      gimp_tool_control (tool, GIMP_TOOL_ACTION_HALT, display);
    }
  else
    {
      gimp_tool_message_literal (tool, display, locked_message);
      gimp_tool_control (tool, GIMP_TOOL_ACTION_HALT, display);
    }
351 352
}

353
static void
354
gimp_move_tool_button_release (GimpTool              *tool,
355
                               const GimpCoords      *coords,
356 357 358 359
                               guint32                time,
                               GdkModifierType        state,
                               GimpButtonReleaseType  release_type,
                               GimpDisplay           *display)
Elliot Lee's avatar
Elliot Lee committed
360
{
361 362 363 364
  GimpMoveTool  *move   = GIMP_MOVE_TOOL (tool);
  GimpGuiConfig *config = GIMP_GUI_CONFIG (display->gimp->config);
  GimpImage     *image  = gimp_display_get_image (display);
  gboolean       flush  = FALSE;
365

366
  gimp_tool_control_halt (tool->control);
367

368 369
  if (! config->move_tool_changes_active ||
      (release_type == GIMP_BUTTON_RELEASE_CANCEL))
Elliot Lee's avatar
Elliot Lee committed
370
    {
371
      if (move->old_active_layer)
372
        {
373 374
          gimp_image_set_active_layer (image, move->old_active_layer);
          move->old_active_layer = NULL;
Elliot Lee's avatar
Elliot Lee committed
375

376
          flush = TRUE;
377
        }
378

379
      if (move->old_active_vectors)
380
        {
381 382
          gimp_image_set_active_vectors (image, move->old_active_vectors);
          move->old_active_vectors = NULL;
383

384
          flush = TRUE;
385
        }
Elliot Lee's avatar
Elliot Lee committed
386 387
    }

388
  if (release_type != GIMP_BUTTON_RELEASE_CANCEL)
Elliot Lee's avatar
Elliot Lee committed
389
    {
390
      if (move->floating_layer)
391
        {
392
          floating_sel_anchor (move->floating_layer);
393

394
          flush = TRUE;
395
        }
Elliot Lee's avatar
Elliot Lee committed
396
    }
397 398 399

  if (flush)
    gimp_image_flush (image);
Elliot Lee's avatar
Elliot Lee committed
400 401
}

402 403 404 405 406 407 408 409 410 411 412 413
static gboolean
gimp_move_tool_key_press (GimpTool    *tool,
                          GdkEventKey *kevent,
                          GimpDisplay *display)
{
  GimpMoveOptions *options = GIMP_MOVE_TOOL_GET_OPTIONS (tool);

  return gimp_edit_selection_tool_translate (tool, kevent,
                                             options->move_type,
                                             display);
}

414 415 416 417
static void
gimp_move_tool_modifier_key (GimpTool        *tool,
                             GdkModifierType  key,
                             gboolean         press,
418 419
                             GdkModifierType  state,
                             GimpDisplay     *display)
420
{
421
  GimpMoveTool    *move    = GIMP_MOVE_TOOL (tool);
422
  GimpMoveOptions *options = GIMP_MOVE_TOOL_GET_OPTIONS (tool);
423

424
  if (key == gimp_get_extend_selection_mask ())
425
    {
426
      g_object_set (options, "move-current", ! options->move_current, NULL);
427
    }
428 429
  else if (key == GDK_MOD1_MASK ||
           key == gimp_get_toggle_behavior_mask ())
430
    {
431 432 433 434 435 436
      GimpTransformType button_type;

      button_type = options->move_type;

      if (press)
        {
437 438
          if (key == (state & (GDK_MOD1_MASK |
                               gimp_get_toggle_behavior_mask ())))
439 440 441
            {
              /*  first modifier pressed  */

442
              move->saved_type = options->move_type;
443 444 445 446
            }
        }
      else
        {
447 448
          if (! (state & (GDK_MOD1_MASK |
                          gimp_get_toggle_behavior_mask ())))
449 450 451
            {
              /*  last modifier released  */

452
              button_type = move->saved_type;
453 454 455 456 457 458 459
            }
        }

      if (state & GDK_MOD1_MASK)
        {
          button_type = GIMP_TRANSFORM_TYPE_SELECTION;
        }
460
      else if (state & gimp_get_toggle_behavior_mask ())
461 462 463 464 465 466 467 468
        {
          button_type = GIMP_TRANSFORM_TYPE_PATH;
        }

      if (button_type != options->move_type)
        {
          g_object_set (options, "move-type", button_type, NULL);
        }
469 470 471
    }
}

472
static void
473 474 475 476 477
gimp_move_tool_oper_update (GimpTool         *tool,
                            const GimpCoords *coords,
                            GdkModifierType   state,
                            gboolean          proximity,
                            GimpDisplay      *display)
478
{
479
  GimpMoveTool     *move    = GIMP_MOVE_TOOL (tool);
480
  GimpMoveOptions  *options = GIMP_MOVE_TOOL_GET_OPTIONS (tool);
481
  GimpDisplayShell *shell   = gimp_display_get_shell (display);
482
  GimpImage        *image   = gimp_display_get_image (display);
483
  GimpGuide        *guide   = NULL;
484 485 486 487

  if (options->move_type == GIMP_TRANSFORM_TYPE_LAYER &&
      ! options->move_current                         &&
      gimp_display_shell_get_show_guides (shell)      &&
488
      proximity)
489
    {
490
      gint snap_distance = display->config->snap_distance;
Michael Natterer's avatar
Michael Natterer committed
491

492
      guide = gimp_image_pick_guide (image, coords->x, coords->y,
493 494
                                     FUNSCALEX (shell, snap_distance),
                                     FUNSCALEY (shell, snap_distance));
495 496
    }

497
  if (move->guide != guide)
498
    {
499
      GimpDrawTool *draw_tool = GIMP_DRAW_TOOL (tool);
500

501 502 503 504
      gimp_draw_tool_pause (draw_tool);

      if (gimp_draw_tool_is_active (draw_tool) &&
          draw_tool->display != display)
505
        gimp_draw_tool_stop (draw_tool);
506

507 508
      move->guide = guide;

509 510 511 512
      if (! gimp_draw_tool_is_active (draw_tool))
        gimp_draw_tool_start (draw_tool, display);

      gimp_draw_tool_resume (draw_tool);
513
    }
514 515
}

516
static void
517 518 519 520
gimp_move_tool_cursor_update (GimpTool         *tool,
                              const GimpCoords *coords,
                              GdkModifierType   state,
                              GimpDisplay      *display)
Elliot Lee's avatar
Elliot Lee committed
521
{
522 523 524 525 526 527 528
  GimpMoveOptions    *options       = GIMP_MOVE_TOOL_GET_OPTIONS (tool);
  GimpDisplayShell   *shell         = gimp_display_get_shell (display);
  GimpImage          *image         = gimp_display_get_image (display);
  GimpCursorType      cursor        = GIMP_CURSOR_MOUSE;
  GimpToolCursorType  tool_cursor   = GIMP_TOOL_CURSOR_MOVE;
  GimpCursorModifier  modifier      = GIMP_CURSOR_MODIFIER_NONE;
  gint                snap_distance = display->config->snap_distance;
Elliot Lee's avatar
Elliot Lee committed
529

530 531
  if (options->move_type == GIMP_TRANSFORM_TYPE_PATH)
    {
532
      tool_cursor = GIMP_TOOL_CURSOR_PATHS;
533 534
      modifier    = GIMP_CURSOR_MODIFIER_MOVE;

535 536
      if (options->move_current)
        {
537 538 539
          GimpItem *item = GIMP_ITEM (gimp_image_get_active_vectors (image));

          if (! item || gimp_item_is_position_locked (item))
540
            modifier = GIMP_CURSOR_MODIFIER_BAD;
541 542 543
        }
      else
        {
544 545 546 547
          if (gimp_image_pick_vectors (image,
                                       coords->x, coords->y,
                                       FUNSCALEX (shell, snap_distance),
                                       FUNSCALEY (shell, snap_distance)))
548
            {
549
              tool_cursor = GIMP_TOOL_CURSOR_HAND;
550
            }
551 552 553 554
          else
            {
              modifier = GIMP_CURSOR_MODIFIER_BAD;
            }
555 556 557
        }
    }
  else if (options->move_type == GIMP_TRANSFORM_TYPE_SELECTION)
558
    {
559
      tool_cursor = GIMP_TOOL_CURSOR_RECT_SELECT;
560 561
      modifier    = GIMP_CURSOR_MODIFIER_MOVE;

562
      if (gimp_channel_is_empty (gimp_image_get_mask (image)))
563
        modifier = GIMP_CURSOR_MODIFIER_BAD;
564
    }
565
  else if (options->move_current)
566
    {
567 568 569
      GimpItem *item = GIMP_ITEM (gimp_image_get_active_drawable (image));

      if (! item || gimp_item_is_position_locked (item))
570
        modifier = GIMP_CURSOR_MODIFIER_BAD;
571
    }
Elliot Lee's avatar
Elliot Lee committed
572 573
  else
    {
574
      GimpLayer  *layer;
Michael Natterer's avatar
Michael Natterer committed
575

576
      if (gimp_display_shell_get_show_guides (shell) &&
577
          gimp_image_pick_guide (image, coords->x, coords->y,
578 579
                                 FUNSCALEX (shell, snap_distance),
                                 FUNSCALEY (shell, snap_distance)))
580
        {
581
          tool_cursor = GIMP_TOOL_CURSOR_HAND;
582
          modifier    = GIMP_CURSOR_MODIFIER_MOVE;
583
        }
584
      else if ((layer = gimp_image_pick_layer (image,
585
                                               coords->x, coords->y)))
586 587
        {
          /*  if there is a floating selection, and this aint it...  */
588
          if (gimp_image_get_floating_selection (image) &&
589 590
              ! gimp_layer_is_floating_sel (layer))
            {
591
              tool_cursor = GIMP_TOOL_CURSOR_MOVE;
592
              modifier    = GIMP_CURSOR_MODIFIER_ANCHOR;
593
            }
594 595 596 597
          else if (gimp_item_is_position_locked (GIMP_ITEM (layer)))
            {
              modifier = GIMP_CURSOR_MODIFIER_BAD;
            }
598
          else if (layer != gimp_image_get_active_layer (image))
599
            {
600
              tool_cursor = GIMP_TOOL_CURSOR_HAND;
Jehan's avatar
Jehan committed
601
              modifier    = GIMP_CURSOR_MODIFIER_MOVE;
602 603
            }
        }
604 605 606 607
      else
        {
          modifier = GIMP_CURSOR_MODIFIER_BAD;
        }
Elliot Lee's avatar
Elliot Lee committed
608
    }
609 610 611 612 613

  gimp_tool_control_set_cursor          (tool->control, cursor);
  gimp_tool_control_set_tool_cursor     (tool->control, tool_cursor);
  gimp_tool_control_set_cursor_modifier (tool->control, modifier);

614
  GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords, state, display);
Elliot Lee's avatar
Elliot Lee committed
615 616 617
}

static void
618
gimp_move_tool_draw (GimpDrawTool *draw_tool)
619
{
620
  GimpMoveTool *move = GIMP_MOVE_TOOL (draw_tool);
621

622 623
  if (move->guide)
    {
624 625 626 627
      GimpCanvasItem *item;
      GimpGuideStyle  style;

      style = gimp_guide_get_style (move->guide);
628

629 630
      item = gimp_draw_tool_add_guide (draw_tool,
                                       gimp_guide_get_orientation (move->guide),
631
                                       gimp_guide_get_position (move->guide),
632
                                       style);
633 634
      gimp_canvas_item_set_highlight (item, TRUE);
    }
Elliot Lee's avatar
Elliot Lee committed
635
}