~ubuntu-branches/ubuntu/jaunty/gimp/jaunty-security

« back to all changes in this revision

Viewing changes to app/tools/gimpblendtool.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2007-05-02 16:33:03 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070502163303-bvzhjzbpw8qglc4y
Tags: 2.3.16-1ubuntu1
* Resynchronized with Debian, remaining Ubuntu changes:
  - debian/rules: i18n magic.
* debian/control.in:
  - Maintainer: Ubuntu Core Developers <ubuntu-devel@lists.ubuntu.com>
* debian/patches/02_help-message.patch,
  debian/patches/03_gimp.desktop.in.in.patch,
  debian/patches/10_dont_show_wizard.patch: updated.
* debian/patches/04_composite-signedness.patch,
  debian/patches/05_add-letter-spacing.patch: dropped, used upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* The GIMP -- an image manipulation program
 
1
/* GIMP - The GNU Image Manipulation Program
2
2
 * Copyright (C) 1995 Spencer Kimball and Peter Mattis
3
3
 *
4
4
 * This program is free software; you can redistribute it and/or modify
22
22
 
23
23
#include <gtk/gtk.h>
24
24
 
25
 
#include "libgimpbase/gimpbase.h"
 
25
#include "libgimpmath/gimpmath.h"
26
26
#include "libgimpwidgets/gimpwidgets.h"
27
27
 
28
28
#include "tools-types.h"
29
29
 
30
 
#include "core/gimp.h"
31
30
#include "core/gimpdrawable.h"
32
31
#include "core/gimpdrawable-blend.h"
33
32
#include "core/gimpgradient.h"
34
33
#include "core/gimpimage.h"
35
34
#include "core/gimpprogress.h"
36
 
#include "core/gimptoolinfo.h"
37
35
 
38
36
#include "widgets/gimphelp-ids.h"
 
37
#include "widgets/gimpwidgets-utils.h"
39
38
 
40
39
#include "display/gimpdisplay.h"
41
40
 
52
51
 
53
52
/*  local function prototypes  */
54
53
 
55
 
static void    gimp_blend_tool_class_init        (GimpBlendToolClass *klass);
56
 
static void    gimp_blend_tool_init              (GimpBlendTool      *blend_tool);
57
 
 
58
 
static void    gimp_blend_tool_button_press      (GimpTool        *tool,
59
 
                                                  GimpCoords      *coords,
60
 
                                                  guint32          time,
61
 
                                                  GdkModifierType  state,
62
 
                                                  GimpDisplay     *gdisp);
63
 
static void    gimp_blend_tool_button_release    (GimpTool        *tool,
64
 
                                                  GimpCoords      *coords,
65
 
                                                  guint32          time,
66
 
                                                  GdkModifierType  state,
67
 
                                                  GimpDisplay     *gdisp);
68
 
static void    gimp_blend_tool_motion            (GimpTool        *tool,
69
 
                                                  GimpCoords      *coords,
70
 
                                                  guint32          time,
71
 
                                                  GdkModifierType  state,
72
 
                                                  GimpDisplay     *gdisp);
73
 
static void    gimp_blend_tool_cursor_update     (GimpTool        *tool,
74
 
                                                  GimpCoords      *coords,
75
 
                                                  GdkModifierType  state,
76
 
                                                  GimpDisplay     *gdisp);
77
 
 
78
 
static void    gimp_blend_tool_draw              (GimpDrawTool    *draw_tool);
79
 
 
80
 
 
81
 
/*  private variables  */
82
 
 
83
 
static GimpDrawToolClass *parent_class = NULL;
84
 
 
85
 
 
86
 
/*  public functions  */
 
54
static gboolean gimp_blend_tool_initialize        (GimpTool              *tool,
 
55
                                                   GimpDisplay           *display,
 
56
                                                   GError               **error);
 
57
static void   gimp_blend_tool_button_press        (GimpTool              *tool,
 
58
                                                   GimpCoords            *coords,
 
59
                                                   guint32                time,
 
60
                                                   GdkModifierType        state,
 
61
                                                   GimpDisplay           *display);
 
62
static void   gimp_blend_tool_button_release      (GimpTool              *tool,
 
63
                                                   GimpCoords            *coords,
 
64
                                                   guint32                time,
 
65
                                                   GdkModifierType        state,
 
66
                                                   GimpButtonReleaseType  release_type,
 
67
                                                   GimpDisplay           *display);
 
68
static void   gimp_blend_tool_motion              (GimpTool              *tool,
 
69
                                                   GimpCoords            *coords,
 
70
                                                   guint32                time,
 
71
                                                   GdkModifierType        state,
 
72
                                                   GimpDisplay           *display);
 
73
static void   gimp_blend_tool_active_modifier_key (GimpTool              *tool,
 
74
                                                   GdkModifierType        key,
 
75
                                                   gboolean               press,
 
76
                                                   GdkModifierType        state,
 
77
                                                   GimpDisplay           *display);
 
78
static void   gimp_blend_tool_cursor_update       (GimpTool              *tool,
 
79
                                                   GimpCoords            *coords,
 
80
                                                   GdkModifierType        state,
 
81
                                                   GimpDisplay           *display);
 
82
 
 
83
static void   gimp_blend_tool_draw                (GimpDrawTool          *draw_tool);
 
84
 
 
85
static void   gimp_blend_tool_push_status         (GimpBlendTool         *blend_tool,
 
86
                                                   GdkModifierType        state,
 
87
                                                   GimpDisplay           *display);
 
88
 
 
89
 
 
90
G_DEFINE_TYPE (GimpBlendTool, gimp_blend_tool, GIMP_TYPE_DRAW_TOOL)
 
91
 
 
92
#define parent_class gimp_blend_tool_parent_class
 
93
 
87
94
 
88
95
void
89
96
gimp_blend_tool_register (GimpToolRegisterCallback  callback,
99
106
                GIMP_CONTEXT_GRADIENT_MASK,
100
107
                "gimp-blend-tool",
101
108
                _("Blend"),
102
 
                _("Fill with a color gradient"),
 
109
                _("Blend Tool: Fill selected area with a color gradient"),
103
110
                N_("Blen_d"), "L",
104
111
                NULL, GIMP_HELP_TOOL_BLEND,
105
112
                GIMP_STOCK_TOOL_BLEND,
106
113
                data);
107
114
}
108
115
 
109
 
GType
110
 
gimp_blend_tool_get_type (void)
111
 
{
112
 
  static GType tool_type = 0;
113
 
 
114
 
  if (! tool_type)
115
 
    {
116
 
      static const GTypeInfo tool_info =
117
 
      {
118
 
        sizeof (GimpBlendToolClass),
119
 
        (GBaseInitFunc) NULL,
120
 
        (GBaseFinalizeFunc) NULL,
121
 
        (GClassInitFunc) gimp_blend_tool_class_init,
122
 
        NULL,           /* class_finalize */
123
 
        NULL,           /* class_data     */
124
 
        sizeof (GimpBlendTool),
125
 
        0,              /* n_preallocs    */
126
 
        (GInstanceInitFunc) gimp_blend_tool_init,
127
 
      };
128
 
 
129
 
      tool_type = g_type_register_static (GIMP_TYPE_DRAW_TOOL,
130
 
                                          "GimpBlendTool",
131
 
                                          &tool_info, 0);
132
 
    }
133
 
 
134
 
  return tool_type;
135
 
}
136
 
 
137
 
 
138
 
/*  private functions  */
139
 
 
140
116
static void
141
117
gimp_blend_tool_class_init (GimpBlendToolClass *klass)
142
118
{
143
 
  GObjectClass      *object_class;
144
 
  GimpToolClass     *tool_class;
145
 
  GimpDrawToolClass *draw_tool_class;
146
 
 
147
 
  object_class    = G_OBJECT_CLASS (klass);
148
 
  tool_class      = GIMP_TOOL_CLASS (klass);
149
 
  draw_tool_class = GIMP_DRAW_TOOL_CLASS (klass);
150
 
 
151
 
  parent_class = g_type_class_peek_parent (klass);
152
 
 
153
 
  tool_class->button_press   = gimp_blend_tool_button_press;
154
 
  tool_class->button_release = gimp_blend_tool_button_release;
155
 
  tool_class->motion         = gimp_blend_tool_motion;
156
 
  tool_class->cursor_update  = gimp_blend_tool_cursor_update;
157
 
 
158
 
  draw_tool_class->draw      = gimp_blend_tool_draw;
 
119
  GimpToolClass     *tool_class      = GIMP_TOOL_CLASS (klass);
 
120
  GimpDrawToolClass *draw_tool_class = GIMP_DRAW_TOOL_CLASS (klass);
 
121
 
 
122
  tool_class->initialize          = gimp_blend_tool_initialize;
 
123
  tool_class->button_press        = gimp_blend_tool_button_press;
 
124
  tool_class->button_release      = gimp_blend_tool_button_release;
 
125
  tool_class->motion              = gimp_blend_tool_motion;
 
126
  tool_class->active_modifier_key = gimp_blend_tool_active_modifier_key;
 
127
  tool_class->cursor_update       = gimp_blend_tool_cursor_update;
 
128
 
 
129
  draw_tool_class->draw           = gimp_blend_tool_draw;
159
130
}
160
131
 
161
132
static void
162
133
gimp_blend_tool_init (GimpBlendTool *blend_tool)
163
134
{
164
 
  GimpTool *tool;
165
 
 
166
 
  tool = GIMP_TOOL (blend_tool);
167
 
 
168
 
  gimp_tool_control_set_scroll_lock (tool->control, TRUE);
169
 
  gimp_tool_control_set_tool_cursor (tool->control, GIMP_TOOL_CURSOR_BLEND);
170
 
 
 
135
  GimpTool *tool = GIMP_TOOL (blend_tool);
 
136
 
 
137
  gimp_tool_control_set_scroll_lock     (tool->control, TRUE);
 
138
  gimp_tool_control_set_cursor          (tool->control,
 
139
                                         GIMP_CURSOR_MOUSE);
 
140
  gimp_tool_control_set_tool_cursor     (tool->control,
 
141
                                         GIMP_TOOL_CURSOR_BLEND);
 
142
  gimp_tool_control_set_action_value_1  (tool->control,
 
143
                                         "context/context-opacity-set");
 
144
  gimp_tool_control_set_action_object_1 (tool->control,
 
145
                                         "context/context-gradient-select-set");
 
146
}
 
147
 
 
148
static gboolean
 
149
gimp_blend_tool_initialize (GimpTool     *tool,
 
150
                            GimpDisplay  *display,
 
151
                            GError      **error)
 
152
{
 
153
  GimpDrawable *drawable = gimp_image_active_drawable (display->image);
 
154
 
 
155
  if (! GIMP_TOOL_CLASS (parent_class)->initialize (tool, display, error))
 
156
    {
 
157
      return FALSE;
 
158
    }
 
159
 
 
160
  if (gimp_drawable_is_indexed (drawable))
 
161
    {
 
162
      g_set_error (error, 0, 0,
 
163
                   _("Blend does not operate on indexed layers."));
 
164
      return FALSE;
 
165
    }
 
166
 
 
167
  return TRUE;
171
168
}
172
169
 
173
170
static void
175
172
                              GimpCoords      *coords,
176
173
                              guint32          time,
177
174
                              GdkModifierType  state,
178
 
                              GimpDisplay     *gdisp)
 
175
                              GimpDisplay     *display)
179
176
{
180
 
  GimpBlendTool *blend_tool;
181
 
  GimpDrawable  *drawable;
182
 
  gint           off_x, off_y;
183
 
 
184
 
  blend_tool = GIMP_BLEND_TOOL (tool);
185
 
 
186
 
  drawable = gimp_image_active_drawable (gdisp->gimage);
187
 
 
188
 
  switch (gimp_drawable_type (drawable))
189
 
    {
190
 
    case GIMP_INDEXED_IMAGE: case GIMP_INDEXEDA_IMAGE:
191
 
      g_message (_("Blend: Invalid for indexed images."));
192
 
      return;
193
 
 
194
 
      break;
195
 
    default:
196
 
      break;
197
 
    }
198
 
 
199
 
  gimp_item_offsets (GIMP_ITEM (drawable), &off_x, &off_y);
200
 
 
201
 
  blend_tool->endx = blend_tool->startx = coords->x - off_x;
202
 
  blend_tool->endy = blend_tool->starty = coords->y - off_y;
203
 
 
204
 
  tool->gdisp = gdisp;
 
177
  GimpBlendTool *blend_tool = GIMP_BLEND_TOOL (tool);
 
178
 
 
179
  blend_tool->start_x = blend_tool->end_x = coords->x;
 
180
  blend_tool->start_y = blend_tool->end_y = coords->y;
 
181
 
 
182
  blend_tool->last_x = blend_tool->mouse_x = coords->x;
 
183
  blend_tool->last_y = blend_tool->mouse_y = coords->y;
 
184
 
 
185
  tool->display = display;
205
186
 
206
187
  gimp_tool_control_activate (tool->control);
207
188
 
208
 
  /* initialize the statusbar display */
209
 
  gimp_tool_push_status_coords (tool, _("Blend: "), 0, ", ", 0);
 
189
  gimp_blend_tool_push_status (blend_tool, state, display);
210
190
 
211
 
  /*  Start drawing the blend tool  */
212
 
  gimp_draw_tool_start (GIMP_DRAW_TOOL (tool), gdisp);
 
191
  gimp_draw_tool_start (GIMP_DRAW_TOOL (tool), display);
213
192
}
214
193
 
215
194
static void
216
 
gimp_blend_tool_button_release (GimpTool        *tool,
217
 
                                GimpCoords      *coords,
218
 
                                guint32          time,
219
 
                                GdkModifierType  state,
220
 
                                GimpDisplay     *gdisp)
 
195
gimp_blend_tool_button_release (GimpTool              *tool,
 
196
                                GimpCoords            *coords,
 
197
                                guint32                time,
 
198
                                GdkModifierType        state,
 
199
                                GimpButtonReleaseType  release_type,
 
200
                                GimpDisplay           *display)
221
201
{
222
 
  GimpBlendTool    *blend_tool;
223
 
  GimpPaintOptions *paint_options;
224
 
  GimpBlendOptions *options;
225
 
  GimpContext      *context;
226
 
  GimpImage        *gimage;
227
 
 
228
 
  blend_tool    = GIMP_BLEND_TOOL (tool);
229
 
  paint_options = GIMP_PAINT_OPTIONS (tool->tool_info->tool_options);
230
 
  options       = GIMP_BLEND_OPTIONS (paint_options);
231
 
  context       = GIMP_CONTEXT (options);
232
 
 
233
 
  gimage = gdisp->gimage;
234
 
 
235
 
  gimp_tool_pop_status (tool);
 
202
  GimpBlendTool    *blend_tool    = GIMP_BLEND_TOOL (tool);
 
203
  GimpBlendOptions *options       = GIMP_BLEND_TOOL_GET_OPTIONS (tool);
 
204
  GimpPaintOptions *paint_options = GIMP_PAINT_OPTIONS (options);
 
205
  GimpContext      *context       = GIMP_CONTEXT (options);
 
206
  GimpImage        *image         = display->image;
 
207
 
 
208
  gimp_tool_pop_status (tool, display);
236
209
 
237
210
  gimp_draw_tool_stop (GIMP_DRAW_TOOL (tool));
238
211
 
239
212
  gimp_tool_control_halt (tool->control);
240
213
 
241
 
  /*  if the 3rd button isn't pressed, fill the selected region  */
242
 
  if (! (state & GDK_BUTTON3_MASK) &&
243
 
      ((blend_tool->startx != blend_tool->endx) ||
244
 
       (blend_tool->starty != blend_tool->endy)))
 
214
  if ((release_type != GIMP_BUTTON_RELEASE_CANCEL) &&
 
215
      ((blend_tool->start_x != blend_tool->end_x) ||
 
216
       (blend_tool->start_y != blend_tool->end_y)))
245
217
    {
246
218
      GimpProgress *progress;
247
 
 
248
 
      progress = gimp_progress_start (GIMP_PROGRESS (gdisp),
249
 
                                      _("Blending..."), FALSE);
250
 
 
251
 
      gimp_drawable_blend (gimp_image_active_drawable (gimage),
 
219
      gint          off_x;
 
220
      gint          off_y;
 
221
 
 
222
      progress = gimp_progress_start (GIMP_PROGRESS (display),
 
223
                                      _("Blending"), FALSE);
 
224
 
 
225
      gimp_item_offsets (GIMP_ITEM (gimp_image_active_drawable (image)),
 
226
                         &off_x, &off_y);
 
227
 
 
228
      gimp_drawable_blend (gimp_image_active_drawable (image),
252
229
                           context,
253
230
                           GIMP_CUSTOM_MODE,
254
231
                           gimp_context_get_paint_mode (context),
261
238
                           options->supersample_depth,
262
239
                           options->supersample_threshold,
263
240
                           options->dither,
264
 
                           blend_tool->startx,
265
 
                           blend_tool->starty,
266
 
                           blend_tool->endx,
267
 
                           blend_tool->endy,
 
241
                           blend_tool->start_x - off_x,
 
242
                           blend_tool->start_y - off_y,
 
243
                           blend_tool->end_x - off_x,
 
244
                           blend_tool->end_y - off_y,
268
245
                           progress);
269
246
 
270
247
      if (progress)
271
248
        gimp_progress_end (progress);
272
249
 
273
 
      gimp_image_flush (gimage);
 
250
      gimp_image_flush (image);
274
251
    }
275
252
}
276
253
 
279
256
                        GimpCoords      *coords,
280
257
                        guint32          time,
281
258
                        GdkModifierType  state,
282
 
                        GimpDisplay     *gdisp)
 
259
                        GimpDisplay     *display)
283
260
{
284
 
  GimpBlendTool    *blend_tool;
285
 
  gint              off_x, off_y;
286
 
 
287
 
  blend_tool = GIMP_BLEND_TOOL (tool);
 
261
  GimpBlendTool *blend_tool = GIMP_BLEND_TOOL (tool);
288
262
 
289
263
  gimp_draw_tool_pause (GIMP_DRAW_TOOL (tool));
290
264
 
291
 
  gimp_item_offsets (GIMP_ITEM (gimp_image_active_drawable (gdisp->gimage)),
292
 
                     &off_x, &off_y);
293
 
 
294
 
  /*  Get the current coordinates  */
295
 
  blend_tool->endx = coords->x - off_x;
296
 
  blend_tool->endy = coords->y - off_y;
 
265
  blend_tool->mouse_x = coords->x;
 
266
  blend_tool->mouse_y = coords->y;
 
267
 
 
268
  /* Move the whole line if alt is pressed */
 
269
  if (state & GDK_MOD1_MASK)
 
270
    {
 
271
      gdouble dx = blend_tool->last_x - coords->x;
 
272
      gdouble dy = blend_tool->last_y - coords->y;
 
273
 
 
274
      blend_tool->start_x -= dx;
 
275
      blend_tool->start_y -= dy;
 
276
 
 
277
      blend_tool->end_x -= dx;
 
278
      blend_tool->end_y -= dy;
 
279
    }
 
280
  else
 
281
    {
 
282
      blend_tool->end_x = coords->x;
 
283
      blend_tool->end_y = coords->y;
 
284
    }
297
285
 
298
286
  /* Restrict to multiples of 15 degrees if ctrl is pressed */
299
287
  if (state & GDK_CONTROL_MASK)
300
288
    {
301
 
      gimp_tool_motion_constrain (blend_tool->startx, blend_tool->starty,
302
 
                                  &blend_tool->endx, &blend_tool->endy);
 
289
      gimp_tool_motion_constrain (blend_tool->start_x, blend_tool->start_y,
 
290
                                  &blend_tool->end_x, &blend_tool->end_y);
303
291
    }
304
292
 
305
 
  gimp_tool_pop_status (tool);
306
 
 
307
 
  gimp_tool_push_status_coords (tool,
308
 
                                _("Blend: "),
309
 
                                blend_tool->endx - blend_tool->startx,
310
 
                                ", ",
311
 
                                blend_tool->endy - blend_tool->starty);
 
293
  gimp_tool_pop_status (tool, display);
 
294
  gimp_blend_tool_push_status (blend_tool, state, display);
312
295
 
313
296
  gimp_draw_tool_resume (GIMP_DRAW_TOOL (tool));
 
297
 
 
298
  blend_tool->last_x = coords->x;
 
299
  blend_tool->last_y = coords->y;
 
300
}
 
301
 
 
302
static void
 
303
gimp_blend_tool_active_modifier_key (GimpTool        *tool,
 
304
                                     GdkModifierType  key,
 
305
                                     gboolean         press,
 
306
                                     GdkModifierType  state,
 
307
                                     GimpDisplay     *display)
 
308
{
 
309
  GimpBlendTool *blend_tool = GIMP_BLEND_TOOL (tool);
 
310
 
 
311
  if (key == GDK_CONTROL_MASK)
 
312
    {
 
313
      gimp_draw_tool_pause (GIMP_DRAW_TOOL (tool));
 
314
 
 
315
      blend_tool->end_x = blend_tool->mouse_x;
 
316
      blend_tool->end_y = blend_tool->mouse_y;
 
317
 
 
318
      /* Restrict to multiples of 15 degrees if ctrl is pressed */
 
319
      if (press)
 
320
        {
 
321
          gimp_tool_motion_constrain (blend_tool->start_x, blend_tool->start_y,
 
322
                                      &blend_tool->end_x, &blend_tool->end_y);
 
323
        }
 
324
 
 
325
      gimp_tool_pop_status (tool, display);
 
326
      gimp_blend_tool_push_status (blend_tool, state, display);
 
327
 
 
328
      gimp_draw_tool_resume (GIMP_DRAW_TOOL (tool));
 
329
    }
314
330
}
315
331
 
316
332
static void
317
333
gimp_blend_tool_cursor_update (GimpTool        *tool,
318
334
                               GimpCoords      *coords,
319
335
                               GdkModifierType  state,
320
 
                               GimpDisplay     *gdisp)
 
336
                               GimpDisplay     *display)
321
337
{
322
 
  switch (gimp_drawable_type (gimp_image_active_drawable (gdisp->gimage)))
 
338
  switch (gimp_drawable_type (gimp_image_active_drawable (display->image)))
323
339
    {
324
340
    case GIMP_INDEXED_IMAGE:
325
341
    case GIMP_INDEXEDA_IMAGE:
326
 
      gimp_tool_control_set_cursor (tool->control, GIMP_CURSOR_BAD);
 
342
      gimp_tool_control_set_cursor_modifier (tool->control,
 
343
                                             GIMP_CURSOR_MODIFIER_BAD);
327
344
      break;
328
345
    default:
329
 
      gimp_tool_control_set_cursor (tool->control, GIMP_CURSOR_MOUSE);
 
346
      gimp_tool_control_set_cursor_modifier (tool->control,
 
347
                                             GIMP_CURSOR_MODIFIER_NONE);
330
348
      break;
331
349
    }
332
350
 
333
 
  GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords, state, gdisp);
 
351
  GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords, state, display);
334
352
}
335
353
 
336
354
static void
337
355
gimp_blend_tool_draw (GimpDrawTool *draw_tool)
338
356
{
339
 
  GimpBlendTool *blend_tool;
340
 
 
341
 
  blend_tool = GIMP_BLEND_TOOL (draw_tool);
 
357
  GimpBlendTool *blend_tool = GIMP_BLEND_TOOL (draw_tool);
342
358
 
343
359
  /*  Draw start target  */
344
360
  gimp_draw_tool_draw_handle (draw_tool,
345
361
                              GIMP_HANDLE_CROSS,
346
 
                              floor (blend_tool->startx) + 0.5,
347
 
                              floor (blend_tool->starty) + 0.5,
 
362
                              floor (blend_tool->start_x) + 0.5,
 
363
                              floor (blend_tool->start_y) + 0.5,
348
364
                              TARGET_SIZE,
349
365
                              TARGET_SIZE,
350
366
                              GTK_ANCHOR_CENTER,
351
 
                              TRUE);
 
367
                              FALSE);
352
368
 
353
369
  /*  Draw end target  */
354
370
  gimp_draw_tool_draw_handle (draw_tool,
355
371
                              GIMP_HANDLE_CROSS,
356
 
                              floor (blend_tool->endx) + 0.5,
357
 
                              floor (blend_tool->endy) + 0.5,
 
372
                              floor (blend_tool->end_x) + 0.5,
 
373
                              floor (blend_tool->end_y) + 0.5,
358
374
                              TARGET_SIZE,
359
375
                              TARGET_SIZE,
360
376
                              GTK_ANCHOR_CENTER,
361
 
                              TRUE);
 
377
                              FALSE);
362
378
 
363
379
  /*  Draw the line between the start and end coords  */
364
380
  gimp_draw_tool_draw_line (draw_tool,
365
 
                            floor (blend_tool->startx) + 0.5,
366
 
                            floor (blend_tool->starty) + 0.5,
367
 
                            floor (blend_tool->endx) + 0.5,
368
 
                            floor (blend_tool->endy) + 0.5,
369
 
                            TRUE);
 
381
                            floor (blend_tool->start_x) + 0.5,
 
382
                            floor (blend_tool->start_y) + 0.5,
 
383
                            floor (blend_tool->end_x) + 0.5,
 
384
                            floor (blend_tool->end_y) + 0.5,
 
385
                            FALSE);
 
386
}
 
387
 
 
388
static void
 
389
gimp_blend_tool_push_status (GimpBlendTool   *blend_tool,
 
390
                             GdkModifierType  state,
 
391
                             GimpDisplay     *display)
 
392
{
 
393
  gchar *status_help;
 
394
 
 
395
  status_help = gimp_suggest_modifiers ("",
 
396
                                        ((GDK_CONTROL_MASK | GDK_MOD1_MASK)
 
397
                                         & ~state),
 
398
                                        NULL,
 
399
                                        _("%s for constrained angles"),
 
400
                                        _("%s to move the whole line"));
 
401
  gimp_tool_push_status_coords (GIMP_TOOL (blend_tool), display,
 
402
                                _("Blend: "),
 
403
                                blend_tool->end_x - blend_tool->start_x,
 
404
                                ", ",
 
405
                                blend_tool->end_y - blend_tool->start_y,
 
406
                                status_help);
 
407
  g_free (status_help);
370
408
}