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

« back to all changes in this revision

Viewing changes to app/widgets/gimpviewrenderer-frame.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
 * gimpviewrenderer-frame.c
94
94
    }
95
95
}
96
96
 
97
 
GdkPixbuf *
 
97
static GdkPixbuf *
98
98
stretch_frame_image (GdkPixbuf *frame_image,
99
99
                     gint       left_offset,
100
100
                     gint       top_offset,
104
104
                     gint       dest_height)
105
105
{
106
106
  GdkPixbuf *pixbuf;
107
 
  guchar    *pixels;
108
107
  gint       frame_width, frame_height;
109
 
  gint       row_stride;
110
108
  gint       target_width,  target_frame_width;
111
109
  gint       target_height, target_frame_height;
112
110
 
117
115
                           dest_width, dest_height);
118
116
  gdk_pixbuf_fill (pixbuf, 0);
119
117
 
120
 
  row_stride = gdk_pixbuf_get_rowstride (pixbuf);
121
 
  pixels = gdk_pixbuf_get_pixels (pixbuf);
122
 
 
123
 
  target_width = dest_width - left_offset - right_offset;
 
118
  target_width  = dest_width - left_offset - right_offset;
124
119
  target_height = dest_height - top_offset - bottom_offset;
 
120
 
125
121
  target_frame_width  = frame_width - left_offset - right_offset;
126
122
  target_frame_height = frame_height - top_offset - bottom_offset;
127
123
 
130
126
  top_offset    += MIN (target_height / 4, target_frame_height / 4);
131
127
  bottom_offset += MIN (target_height / 4, target_frame_height / 4);
132
128
 
133
 
  target_width = dest_width - left_offset - right_offset;
 
129
  target_width  = dest_width - left_offset - right_offset;
134
130
  target_height = dest_height - top_offset - bottom_offset;
 
131
 
135
132
  target_frame_width  = frame_width - left_offset - right_offset;
136
133
  target_frame_height = frame_height - top_offset - bottom_offset;
137
134
 
236
233
 
237
234
  if (w > 12 && h > 12)
238
235
    {
239
 
      pixbuf = gimp_viewable_get_pixbuf (renderer->viewable, w, h);
 
236
      pixbuf = gimp_viewable_get_pixbuf (renderer->viewable,
 
237
                                         renderer->context,
 
238
                                         w, h);
240
239
      if (!pixbuf)
241
240
        return NULL;
242
241
 
252
251
  else
253
252
    {
254
253
      pixbuf = gimp_viewable_get_pixbuf (renderer->viewable,
 
254
                                         renderer->context,
255
255
                                         width - 2, height - 2);
256
256
      if (!pixbuf)
257
257
        return NULL;