2006-12-10 05:33:38 +08:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
1997-11-25 06:05:25 +08:00
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
2009-01-18 06:28:01 +08:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
1997-11-25 06:05:25 +08:00
|
|
|
* it under the terms of the GNU General Public License as published by
|
2009-01-18 06:28:01 +08:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
1997-11-25 06:05:25 +08:00
|
|
|
* (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
|
2009-01-18 06:28:01 +08:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
1997-11-25 06:05:25 +08:00
|
|
|
*/
|
2000-12-17 05:37:03 +08:00
|
|
|
|
1999-03-07 20:56:03 +08:00
|
|
|
#include "config.h"
|
|
|
|
|
2008-10-10 04:24:04 +08:00
|
|
|
#include <gegl.h>
|
2000-12-17 05:37:03 +08:00
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
2006-08-29 22:46:32 +08:00
|
|
|
#include "libgimpbase/gimpbase.h"
|
2007-03-09 21:00:01 +08:00
|
|
|
#include "libgimpmath/gimpmath.h"
|
2008-10-23 17:42:55 +08:00
|
|
|
#include "libgimpwidgets/gimpwidgets.h"
|
2006-08-29 22:46:32 +08:00
|
|
|
|
2001-09-26 07:23:09 +08:00
|
|
|
#include "display-types.h"
|
2002-05-03 20:45:22 +08:00
|
|
|
|
2010-08-25 00:07:31 +08:00
|
|
|
#include "base/boundary.h"
|
2007-06-07 05:40:31 +08:00
|
|
|
#include "base/tile-manager.h"
|
|
|
|
|
2005-08-06 19:18:26 +08:00
|
|
|
#include "core/gimpcontext.h"
|
2010-08-25 00:07:31 +08:00
|
|
|
#include "core/gimpdrawable.h"
|
2003-06-24 03:34:48 +08:00
|
|
|
#include "core/gimpgrid.h"
|
2006-06-07 06:48:57 +08:00
|
|
|
#include "core/gimpguide.h"
|
2001-05-09 10:32:03 +08:00
|
|
|
#include "core/gimpimage.h"
|
2010-02-04 05:16:02 +08:00
|
|
|
#include "core/gimpimage-grid.h"
|
2007-12-26 01:09:04 +08:00
|
|
|
#include "core/gimpimage-guides.h"
|
|
|
|
#include "core/gimpimage-sample-points.h"
|
2007-06-06 21:45:44 +08:00
|
|
|
#include "core/gimpprojection.h"
|
2007-01-30 18:34:59 +08:00
|
|
|
#include "core/gimpsamplepoint.h"
|
2002-04-15 01:28:58 +08:00
|
|
|
|
2003-09-12 06:24:30 +08:00
|
|
|
#include "vectors/gimpstroke.h"
|
2004-02-07 08:16:52 +08:00
|
|
|
#include "vectors/gimpvectors.h"
|
2003-05-18 22:47:07 +08:00
|
|
|
|
2010-08-27 20:58:43 +08:00
|
|
|
#include "widgets/gimpcairo.h"
|
2003-05-29 19:34:30 +08:00
|
|
|
#include "widgets/gimpwidgets-utils.h"
|
2001-05-09 03:29:15 +08:00
|
|
|
|
2003-11-10 07:24:40 +08:00
|
|
|
#include "gimpcanvas.h"
|
2001-09-26 07:23:09 +08:00
|
|
|
#include "gimpdisplay.h"
|
|
|
|
#include "gimpdisplayshell.h"
|
2003-03-20 19:31:33 +08:00
|
|
|
#include "gimpdisplayshell-appearance.h"
|
2010-08-27 01:13:49 +08:00
|
|
|
#include "gimpdisplayshell-cursor.h"
|
2004-02-07 08:16:52 +08:00
|
|
|
#include "gimpdisplayshell-draw.h"
|
2001-11-02 17:31:21 +08:00
|
|
|
#include "gimpdisplayshell-render.h"
|
2008-08-15 03:23:28 +08:00
|
|
|
#include "gimpdisplayshell-scale.h"
|
2008-07-12 05:26:14 +08:00
|
|
|
#include "gimpdisplayshell-scroll.h"
|
2010-08-12 05:47:46 +08:00
|
|
|
#include "gimpdisplayshell-style.h"
|
2003-01-04 02:01:30 +08:00
|
|
|
#include "gimpdisplayshell-transform.h"
|
2002-05-08 00:23:14 +08:00
|
|
|
|
2001-11-01 05:20:09 +08:00
|
|
|
|
2004-02-07 08:16:52 +08:00
|
|
|
/* public functions */
|
2002-02-17 21:12:16 +08:00
|
|
|
|
2008-08-10 18:54:00 +08:00
|
|
|
/**
|
|
|
|
* gimp_display_shell_get_scaled_image_size:
|
|
|
|
* @shell:
|
|
|
|
* @w:
|
|
|
|
* @h:
|
|
|
|
*
|
|
|
|
* Gets the size of the rendered image after it has been scaled.
|
|
|
|
*
|
|
|
|
**/
|
|
|
|
void
|
2009-10-25 03:02:19 +08:00
|
|
|
gimp_display_shell_draw_get_scaled_image_size (GimpDisplayShell *shell,
|
|
|
|
gint *w,
|
|
|
|
gint *h)
|
2008-08-15 03:23:28 +08:00
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
|
|
|
|
|
|
|
gimp_display_shell_draw_get_scaled_image_size_for_scale (shell,
|
|
|
|
gimp_zoom_model_get_factor (shell->zoom),
|
|
|
|
w,
|
|
|
|
h);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_display_shell_draw_get_scaled_image_size_for_scale:
|
|
|
|
* @shell:
|
|
|
|
* @scale:
|
|
|
|
* @w:
|
|
|
|
* @h:
|
|
|
|
*
|
|
|
|
**/
|
|
|
|
void
|
2009-10-25 03:02:19 +08:00
|
|
|
gimp_display_shell_draw_get_scaled_image_size_for_scale (GimpDisplayShell *shell,
|
|
|
|
gdouble scale,
|
|
|
|
gint *w,
|
|
|
|
gint *h)
|
2008-08-10 18:54:00 +08:00
|
|
|
{
|
2009-10-07 01:20:44 +08:00
|
|
|
GimpImage *image;
|
2008-08-10 18:54:00 +08:00
|
|
|
GimpProjection *proj;
|
|
|
|
TileManager *tiles;
|
2008-08-15 03:23:28 +08:00
|
|
|
gdouble scale_x;
|
|
|
|
gdouble scale_y;
|
2008-08-10 18:54:00 +08:00
|
|
|
gint level;
|
|
|
|
gint level_width;
|
|
|
|
gint level_height;
|
|
|
|
|
|
|
|
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
|
|
|
|
2009-10-07 01:20:44 +08:00
|
|
|
image = gimp_display_get_image (shell->display);
|
|
|
|
|
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
|
|
|
|
|
|
|
proj = gimp_image_get_projection (image);
|
2008-08-10 18:54:00 +08:00
|
|
|
|
2008-08-15 03:23:28 +08:00
|
|
|
gimp_display_shell_calculate_scale_x_and_y (shell, scale, &scale_x, &scale_y);
|
|
|
|
|
|
|
|
level = gimp_projection_get_level (proj, scale_x, scale_y);
|
2008-08-10 18:54:00 +08:00
|
|
|
|
|
|
|
tiles = gimp_projection_get_tiles_at_level (proj, level, NULL);
|
|
|
|
|
|
|
|
level_width = tile_manager_width (tiles);
|
|
|
|
level_height = tile_manager_height (tiles);
|
|
|
|
|
2008-08-15 03:23:28 +08:00
|
|
|
if (w) *w = PROJ_ROUND (level_width * (scale_x * (1 << level)));
|
|
|
|
if (h) *h = PROJ_ROUND (level_height * (scale_y * (1 << level)));
|
2008-08-10 18:54:00 +08:00
|
|
|
}
|
|
|
|
|
2001-11-01 05:20:09 +08:00
|
|
|
void
|
2010-05-02 21:40:11 +08:00
|
|
|
gimp_display_shell_draw_guide (GimpDisplayShell *shell,
|
2010-08-12 06:51:58 +08:00
|
|
|
cairo_t *cr,
|
2010-05-02 21:40:11 +08:00
|
|
|
GimpGuide *guide,
|
|
|
|
gboolean active)
|
2001-11-01 05:20:09 +08:00
|
|
|
{
|
2010-08-12 06:51:58 +08:00
|
|
|
gint position;
|
|
|
|
gdouble dx1, dy1, dx2, dy2;
|
|
|
|
gint x1, y1, x2, y2;
|
|
|
|
gint x, y;
|
2001-11-01 05:20:09 +08:00
|
|
|
|
|
|
|
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
2010-08-12 06:51:58 +08:00
|
|
|
g_return_if_fail (cr != NULL);
|
2006-06-07 23:49:59 +08:00
|
|
|
g_return_if_fail (GIMP_IS_GUIDE (guide));
|
2001-11-01 05:20:09 +08:00
|
|
|
|
2006-06-07 23:49:59 +08:00
|
|
|
position = gimp_guide_get_position (guide);
|
|
|
|
if (position < 0)
|
2001-11-01 05:20:09 +08:00
|
|
|
return;
|
|
|
|
|
2010-08-12 06:51:58 +08:00
|
|
|
cairo_clip_extents (cr, &dx1, &dy1, &dx2, &dy2);
|
2003-11-11 03:35:56 +08:00
|
|
|
|
2010-08-12 06:51:58 +08:00
|
|
|
x1 = floor (dx1);
|
|
|
|
y1 = floor (dy1);
|
|
|
|
x2 = ceil (dx2);
|
|
|
|
y2 = ceil (dy2);
|
|
|
|
|
|
|
|
gimp_display_shell_set_guide_style (shell, cr, active);
|
2001-11-01 05:20:09 +08:00
|
|
|
|
2006-06-07 23:49:59 +08:00
|
|
|
switch (gimp_guide_get_orientation (guide))
|
2001-11-01 05:20:09 +08:00
|
|
|
{
|
2003-11-11 03:35:56 +08:00
|
|
|
case GIMP_ORIENTATION_HORIZONTAL:
|
2006-06-07 23:49:59 +08:00
|
|
|
gimp_display_shell_transform_xy (shell, 0, position, &x, &y, FALSE);
|
2010-08-12 06:51:58 +08:00
|
|
|
if (y >= y1 && y < y2)
|
|
|
|
{
|
|
|
|
cairo_move_to (cr, x1, y + 0.5);
|
|
|
|
cairo_line_to (cr, x2, y + 0.5);
|
|
|
|
}
|
2003-11-11 03:35:56 +08:00
|
|
|
break;
|
2003-11-10 09:10:46 +08:00
|
|
|
|
2003-11-11 03:35:56 +08:00
|
|
|
case GIMP_ORIENTATION_VERTICAL:
|
2006-06-07 23:49:59 +08:00
|
|
|
gimp_display_shell_transform_xy (shell, position, 0, &x, &y, FALSE);
|
2010-08-12 06:51:58 +08:00
|
|
|
if (x >= x1 && x < x2)
|
|
|
|
{
|
|
|
|
cairo_move_to (cr, x + 0.5, y1);
|
|
|
|
cairo_line_to (cr, x + 0.5, y2);
|
|
|
|
}
|
2003-11-11 03:35:56 +08:00
|
|
|
break;
|
|
|
|
|
|
|
|
case GIMP_ORIENTATION_UNKNOWN:
|
|
|
|
return;
|
2001-11-01 05:20:09 +08:00
|
|
|
}
|
2003-11-11 03:35:56 +08:00
|
|
|
|
2010-08-12 06:51:58 +08:00
|
|
|
cairo_stroke (cr);
|
2001-11-01 05:20:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2010-05-02 21:40:11 +08:00
|
|
|
gimp_display_shell_draw_guides (GimpDisplayShell *shell,
|
2010-08-12 06:51:58 +08:00
|
|
|
cairo_t *cr)
|
2001-11-01 05:20:09 +08:00
|
|
|
{
|
2009-10-07 01:20:44 +08:00
|
|
|
GimpImage *image;
|
|
|
|
|
2001-11-01 05:20:09 +08:00
|
|
|
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
2010-08-12 06:51:58 +08:00
|
|
|
g_return_if_fail (cr != NULL);
|
2001-11-01 05:20:09 +08:00
|
|
|
|
2009-10-07 01:20:44 +08:00
|
|
|
image = gimp_display_get_image (shell->display);
|
|
|
|
|
|
|
|
if (image && gimp_display_shell_get_show_guides (shell))
|
2001-11-01 05:20:09 +08:00
|
|
|
{
|
2010-08-12 06:51:58 +08:00
|
|
|
GList *list;
|
2001-11-01 05:20:09 +08:00
|
|
|
|
2009-10-07 01:20:44 +08:00
|
|
|
for (list = gimp_image_get_guides (image);
|
2004-02-07 08:16:52 +08:00
|
|
|
list;
|
|
|
|
list = g_list_next (list))
|
2006-04-12 20:49:29 +08:00
|
|
|
{
|
2010-08-12 06:51:58 +08:00
|
|
|
gimp_display_shell_draw_guide (shell, cr, list->data, FALSE);
|
2006-04-12 20:49:29 +08:00
|
|
|
}
|
2001-11-01 05:20:09 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-06-24 03:34:48 +08:00
|
|
|
void
|
2010-05-02 21:40:11 +08:00
|
|
|
gimp_display_shell_draw_grid (GimpDisplayShell *shell,
|
2010-08-11 19:16:55 +08:00
|
|
|
cairo_t *cr)
|
2003-06-24 03:34:48 +08:00
|
|
|
{
|
2009-10-07 01:20:44 +08:00
|
|
|
GimpImage *image;
|
|
|
|
|
2003-06-24 03:34:48 +08:00
|
|
|
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
2010-08-11 19:16:55 +08:00
|
|
|
g_return_if_fail (cr != NULL);
|
2003-06-24 03:34:48 +08:00
|
|
|
|
2009-10-07 01:20:44 +08:00
|
|
|
image = gimp_display_get_image (shell->display);
|
|
|
|
|
|
|
|
if (image && gimp_display_shell_get_show_grid (shell))
|
2003-06-24 03:34:48 +08:00
|
|
|
{
|
2010-08-11 19:16:55 +08:00
|
|
|
GimpGrid *grid;
|
|
|
|
gdouble x, y;
|
|
|
|
gdouble dx1, dy1, dx2, dy2;
|
|
|
|
gint x0, x1, x2, x3;
|
|
|
|
gint y0, y1, y2, y3;
|
|
|
|
gint x_real, y_real;
|
|
|
|
gdouble x_offset, y_offset;
|
|
|
|
gint width, height;
|
2004-09-08 03:08:55 +08:00
|
|
|
|
|
|
|
#define CROSSHAIR 2
|
2003-06-24 03:34:48 +08:00
|
|
|
|
2010-02-04 05:16:02 +08:00
|
|
|
grid = gimp_image_get_grid (image);
|
2004-04-05 01:17:40 +08:00
|
|
|
if (! grid)
|
2003-11-10 09:10:46 +08:00
|
|
|
return;
|
2003-06-24 03:34:48 +08:00
|
|
|
|
2004-05-27 22:51:44 +08:00
|
|
|
g_return_if_fail (grid->xspacing > 0 && grid->yspacing > 0);
|
|
|
|
|
2010-08-11 19:16:55 +08:00
|
|
|
cairo_clip_extents (cr, &dx1, &dy1, &dx2, &dy2);
|
2010-05-02 21:40:11 +08:00
|
|
|
|
2010-08-11 19:16:55 +08:00
|
|
|
x1 = floor (dx1);
|
|
|
|
y1 = floor (dy1);
|
|
|
|
x2 = ceil (dx2);
|
|
|
|
y2 = ceil (dy2);
|
2003-06-24 03:34:48 +08:00
|
|
|
|
2009-10-07 01:20:44 +08:00
|
|
|
width = gimp_image_get_width (image);
|
|
|
|
height = gimp_image_get_height (image);
|
2003-09-06 02:22:03 +08:00
|
|
|
|
2004-05-27 22:51:44 +08:00
|
|
|
x_offset = grid->xoffset;
|
|
|
|
while (x_offset > 0)
|
|
|
|
x_offset -= grid->xspacing;
|
|
|
|
|
|
|
|
y_offset = grid->yoffset;
|
|
|
|
while (y_offset > 0)
|
|
|
|
y_offset -= grid->yspacing;
|
|
|
|
|
2010-08-12 06:09:05 +08:00
|
|
|
gimp_display_shell_set_grid_style (shell, cr, grid);
|
2003-11-11 03:35:56 +08:00
|
|
|
|
2003-10-10 22:11:47 +08:00
|
|
|
switch (grid->style)
|
2003-06-24 03:34:48 +08:00
|
|
|
{
|
2003-09-21 18:45:19 +08:00
|
|
|
case GIMP_GRID_DOTS:
|
2004-05-27 22:51:44 +08:00
|
|
|
for (x = x_offset; x <= width; x += grid->xspacing)
|
2003-07-29 05:26:11 +08:00
|
|
|
{
|
2004-05-27 22:51:44 +08:00
|
|
|
if (x < 0)
|
|
|
|
continue;
|
|
|
|
|
2004-04-05 01:17:40 +08:00
|
|
|
gimp_display_shell_transform_xy (shell,
|
|
|
|
x, 0, &x_real, &y_real,
|
|
|
|
FALSE);
|
|
|
|
|
|
|
|
if (x_real < x1 || x_real >= x2)
|
|
|
|
continue;
|
|
|
|
|
2004-05-27 22:51:44 +08:00
|
|
|
for (y = y_offset; y <= height; y += grid->yspacing)
|
2003-07-29 05:26:11 +08:00
|
|
|
{
|
2004-05-27 22:51:44 +08:00
|
|
|
if (y < 0)
|
|
|
|
continue;
|
|
|
|
|
2003-09-06 02:22:03 +08:00
|
|
|
gimp_display_shell_transform_xy (shell,
|
|
|
|
x, y, &x_real, &y_real,
|
|
|
|
FALSE);
|
|
|
|
|
2004-04-05 01:17:40 +08:00
|
|
|
if (y_real >= y1 && y_real < y2)
|
2010-08-11 19:16:55 +08:00
|
|
|
{
|
|
|
|
cairo_move_to (cr, x_real, y_real + 0.5);
|
|
|
|
cairo_line_to (cr, x_real + 1, y_real + 0.5);
|
|
|
|
}
|
2003-07-29 05:26:11 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2003-09-21 18:45:19 +08:00
|
|
|
case GIMP_GRID_INTERSECTIONS:
|
2004-05-27 22:51:44 +08:00
|
|
|
for (x = x_offset; x <= width; x += grid->xspacing)
|
2003-06-24 03:34:48 +08:00
|
|
|
{
|
2004-05-27 22:51:44 +08:00
|
|
|
if (x < 0)
|
|
|
|
continue;
|
|
|
|
|
2004-04-05 01:17:40 +08:00
|
|
|
gimp_display_shell_transform_xy (shell,
|
|
|
|
x, 0, &x_real, &y_real,
|
|
|
|
FALSE);
|
|
|
|
|
2004-09-08 03:08:55 +08:00
|
|
|
if (x_real + CROSSHAIR < x1 || x_real - CROSSHAIR >= x2)
|
2004-04-05 01:17:40 +08:00
|
|
|
continue;
|
|
|
|
|
2004-05-27 22:51:44 +08:00
|
|
|
for (y = y_offset; y <= height; y += grid->yspacing)
|
2003-06-24 03:34:48 +08:00
|
|
|
{
|
2004-05-27 22:51:44 +08:00
|
|
|
if (y < 0)
|
|
|
|
continue;
|
|
|
|
|
2003-09-06 02:22:03 +08:00
|
|
|
gimp_display_shell_transform_xy (shell,
|
|
|
|
x, y, &x_real, &y_real,
|
|
|
|
FALSE);
|
|
|
|
|
2004-09-08 03:08:55 +08:00
|
|
|
if (y_real + CROSSHAIR < y1 || y_real - CROSSHAIR >= y2)
|
2004-04-05 01:17:40 +08:00
|
|
|
continue;
|
|
|
|
|
2003-06-24 03:34:48 +08:00
|
|
|
if (x_real >= x1 && x_real < x2)
|
2010-08-11 19:16:55 +08:00
|
|
|
{
|
|
|
|
cairo_move_to (cr,
|
|
|
|
x_real + 0.5,
|
|
|
|
CLAMP (y_real - CROSSHAIR,
|
|
|
|
y1, y2 - 1));
|
|
|
|
cairo_line_to (cr,
|
|
|
|
x_real + 0.5,
|
|
|
|
CLAMP (y_real + CROSSHAIR,
|
|
|
|
y1, y2 - 1) + 1);
|
|
|
|
}
|
|
|
|
|
2003-06-24 03:34:48 +08:00
|
|
|
if (y_real >= y1 && y_real < y2)
|
2010-08-11 19:16:55 +08:00
|
|
|
{
|
|
|
|
cairo_move_to (cr,
|
|
|
|
CLAMP (x_real - CROSSHAIR,
|
|
|
|
x1, x2 - 1),
|
|
|
|
y_real + 0.5);
|
|
|
|
cairo_line_to (cr,
|
|
|
|
CLAMP (x_real + CROSSHAIR,
|
|
|
|
x1, x2 - 1) + 1,
|
|
|
|
y_real + 0.5);
|
|
|
|
}
|
2003-06-24 03:34:48 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2003-09-21 18:45:19 +08:00
|
|
|
case GIMP_GRID_ON_OFF_DASH:
|
|
|
|
case GIMP_GRID_DOUBLE_DASH:
|
|
|
|
case GIMP_GRID_SOLID:
|
2004-04-05 01:17:40 +08:00
|
|
|
gimp_display_shell_transform_xy (shell,
|
|
|
|
0, 0, &x0, &y0,
|
|
|
|
FALSE);
|
|
|
|
gimp_display_shell_transform_xy (shell,
|
|
|
|
width, height, &x3, &y3,
|
|
|
|
FALSE);
|
|
|
|
|
2004-05-27 22:51:44 +08:00
|
|
|
for (x = x_offset; x < width; x += grid->xspacing)
|
2003-06-24 03:34:48 +08:00
|
|
|
{
|
2004-05-27 22:51:44 +08:00
|
|
|
if (x < 0)
|
|
|
|
continue;
|
|
|
|
|
2003-09-06 02:22:03 +08:00
|
|
|
gimp_display_shell_transform_xy (shell,
|
|
|
|
x, 0, &x_real, &y_real,
|
|
|
|
FALSE);
|
|
|
|
|
2004-04-05 01:17:40 +08:00
|
|
|
if (x_real >= x1 && x_real < x2)
|
2010-08-11 19:16:55 +08:00
|
|
|
{
|
|
|
|
cairo_move_to (cr, x_real + 0.5, y0);
|
|
|
|
cairo_line_to (cr, x_real + 0.5, y3 + 1);
|
|
|
|
}
|
2003-06-24 03:34:48 +08:00
|
|
|
}
|
|
|
|
|
2004-05-27 22:51:44 +08:00
|
|
|
for (y = y_offset; y < height; y += grid->yspacing)
|
2003-06-24 03:34:48 +08:00
|
|
|
{
|
2004-05-27 22:51:44 +08:00
|
|
|
if (y < 0)
|
|
|
|
continue;
|
|
|
|
|
2003-09-06 02:22:03 +08:00
|
|
|
gimp_display_shell_transform_xy (shell,
|
|
|
|
0, y, &x_real, &y_real,
|
|
|
|
FALSE);
|
|
|
|
|
2004-04-05 01:17:40 +08:00
|
|
|
if (y_real >= y1 && y_real < y2)
|
2010-08-11 19:16:55 +08:00
|
|
|
{
|
|
|
|
cairo_move_to (cr, x0, y_real + 0.5);
|
|
|
|
cairo_line_to (cr, x3 + 1, y_real + 0.5);
|
|
|
|
}
|
2003-06-24 03:34:48 +08:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2003-09-06 02:22:03 +08:00
|
|
|
|
2010-08-11 19:16:55 +08:00
|
|
|
cairo_stroke (cr);
|
2003-06-24 03:34:48 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-08-06 19:18:26 +08:00
|
|
|
void
|
|
|
|
gimp_display_shell_draw_pen (GimpDisplayShell *shell,
|
2010-08-24 03:59:27 +08:00
|
|
|
cairo_t *cr,
|
2005-08-06 19:18:26 +08:00
|
|
|
const GimpVector2 *points,
|
2010-08-24 03:59:27 +08:00
|
|
|
gint n_points,
|
2005-08-06 19:18:26 +08:00
|
|
|
GimpContext *context,
|
|
|
|
GimpActiveColor color,
|
|
|
|
gint width)
|
|
|
|
{
|
2010-08-24 03:59:27 +08:00
|
|
|
gint i;
|
|
|
|
gint x, y;
|
2005-08-06 19:18:26 +08:00
|
|
|
|
|
|
|
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
2010-08-24 03:59:27 +08:00
|
|
|
g_return_if_fail (cr != NULL);
|
2005-08-06 19:18:26 +08:00
|
|
|
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
2010-08-24 03:59:27 +08:00
|
|
|
g_return_if_fail (n_points == 0 || points != NULL);
|
2005-08-06 19:18:26 +08:00
|
|
|
|
2010-08-24 03:59:27 +08:00
|
|
|
if (n_points == 0)
|
|
|
|
return;
|
2005-08-06 19:18:26 +08:00
|
|
|
|
2010-08-24 03:59:27 +08:00
|
|
|
gimp_display_shell_set_pen_style (shell, cr, context, color, width);
|
2010-08-25 19:01:12 +08:00
|
|
|
cairo_translate (cr, 0.5, 0.5);
|
2005-08-06 19:18:26 +08:00
|
|
|
|
2010-08-24 03:59:27 +08:00
|
|
|
gimp_display_shell_transform_xy (shell,
|
|
|
|
points[0].x, points[0].y,
|
|
|
|
&x, &y, FALSE);
|
2005-08-06 21:50:02 +08:00
|
|
|
|
2010-08-24 03:59:27 +08:00
|
|
|
cairo_move_to (cr, x, y);
|
2005-08-06 19:23:58 +08:00
|
|
|
|
2010-08-24 03:59:27 +08:00
|
|
|
for (i = 1; i < n_points; i++)
|
|
|
|
{
|
|
|
|
gimp_display_shell_transform_xy (shell,
|
|
|
|
points[i].x, points[i].y,
|
|
|
|
&x, &y, FALSE);
|
2005-08-06 21:50:02 +08:00
|
|
|
|
2010-08-24 03:59:27 +08:00
|
|
|
cairo_line_to (cr, x, y);
|
|
|
|
}
|
2005-08-06 21:50:02 +08:00
|
|
|
|
2010-08-24 03:59:27 +08:00
|
|
|
if (i == 1)
|
|
|
|
cairo_line_to (cr, x, y);
|
2005-08-06 19:18:26 +08:00
|
|
|
|
2010-08-24 03:59:27 +08:00
|
|
|
cairo_stroke (cr);
|
2005-08-06 19:18:26 +08:00
|
|
|
}
|
|
|
|
|
2005-03-05 08:10:40 +08:00
|
|
|
void
|
2010-05-02 21:58:51 +08:00
|
|
|
gimp_display_shell_draw_sample_point (GimpDisplayShell *shell,
|
2010-08-12 19:13:15 +08:00
|
|
|
cairo_t *cr,
|
2010-05-02 21:58:51 +08:00
|
|
|
GimpSamplePoint *sample_point,
|
|
|
|
gboolean active)
|
2005-03-05 08:10:40 +08:00
|
|
|
{
|
2010-08-12 19:13:15 +08:00
|
|
|
GimpImage *image;
|
|
|
|
gdouble dx1, dy1, dx2, dy2;
|
|
|
|
gint x1, x2, y1, y2;
|
|
|
|
gint sx1, sx2, sy1, sy2;
|
|
|
|
gdouble x, y;
|
|
|
|
PangoLayout *layout;
|
2005-03-05 08:10:40 +08:00
|
|
|
|
|
|
|
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
2010-08-12 19:13:15 +08:00
|
|
|
g_return_if_fail (cr != NULL);
|
2005-03-05 08:10:40 +08:00
|
|
|
g_return_if_fail (sample_point != NULL);
|
|
|
|
|
|
|
|
if (sample_point->x < 0)
|
|
|
|
return;
|
|
|
|
|
2009-10-07 01:20:44 +08:00
|
|
|
image = gimp_display_get_image (shell->display);
|
|
|
|
|
2010-08-12 19:13:15 +08:00
|
|
|
cairo_clip_extents (cr, &dx1, &dy1, &dx2, &dy2);
|
|
|
|
|
|
|
|
x1 = floor (dx1);
|
|
|
|
y1 = floor (dy1);
|
|
|
|
x2 = ceil (dx2);
|
|
|
|
y2 = ceil (dy2);
|
|
|
|
|
2005-03-20 06:04:31 +08:00
|
|
|
gimp_display_shell_transform_xy_f (shell,
|
|
|
|
sample_point->x + 0.5,
|
|
|
|
sample_point->y + 0.5,
|
|
|
|
&x, &y, FALSE);
|
2005-03-05 08:10:40 +08:00
|
|
|
|
2010-08-12 19:13:15 +08:00
|
|
|
sx1 = floor (x - GIMP_SAMPLE_POINT_DRAW_SIZE);
|
|
|
|
sx2 = ceil (x + GIMP_SAMPLE_POINT_DRAW_SIZE);
|
|
|
|
sy1 = floor (y - GIMP_SAMPLE_POINT_DRAW_SIZE);
|
|
|
|
sy2 = ceil (y + GIMP_SAMPLE_POINT_DRAW_SIZE);
|
2005-03-05 08:10:40 +08:00
|
|
|
|
2010-08-12 19:13:15 +08:00
|
|
|
if (sx1 > x2 ||
|
|
|
|
sx2 < x1 ||
|
|
|
|
sy1 > y2 ||
|
|
|
|
sy2 < y1)
|
2005-03-05 08:10:40 +08:00
|
|
|
return;
|
|
|
|
|
2010-08-12 19:13:15 +08:00
|
|
|
gimp_display_shell_set_sample_point_style (shell, cr, active);
|
2005-03-09 08:23:19 +08:00
|
|
|
|
|
|
|
#define HALF_SIZE (GIMP_SAMPLE_POINT_DRAW_SIZE / 2)
|
|
|
|
|
2010-08-12 19:13:15 +08:00
|
|
|
cairo_move_to (cr, x + 0.5, sy1);
|
|
|
|
cairo_line_to (cr, x + 0.5, sy1 + HALF_SIZE);
|
|
|
|
|
|
|
|
cairo_move_to (cr, x + 0.5, sy2);
|
|
|
|
cairo_line_to (cr, x + 0.5, sy2 - HALF_SIZE);
|
|
|
|
|
|
|
|
cairo_move_to (cr, sx1, y + 0.5);
|
|
|
|
cairo_line_to (cr, sx1 + HALF_SIZE, y + 0.5);
|
|
|
|
|
|
|
|
cairo_move_to (cr, sx2, y + 0.5);
|
|
|
|
cairo_line_to (cr, sx2 - HALF_SIZE, y + 0.5);
|
|
|
|
|
|
|
|
cairo_arc_negative (cr, x + 0.5, y + 0.5, HALF_SIZE, 0.0, 0.5 * G_PI);
|
|
|
|
|
|
|
|
cairo_stroke (cr);
|
|
|
|
|
|
|
|
layout =
|
|
|
|
gimp_canvas_get_layout (GIMP_CANVAS (shell->canvas),
|
|
|
|
"%d",
|
|
|
|
g_list_index (gimp_image_get_sample_points (image),
|
|
|
|
sample_point) + 1);
|
|
|
|
|
|
|
|
cairo_move_to (cr, x + 2, y + 2);
|
|
|
|
pango_cairo_show_layout (cr, layout);
|
|
|
|
|
|
|
|
cairo_fill (cr);
|
2005-03-05 08:10:40 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2010-05-02 21:58:51 +08:00
|
|
|
gimp_display_shell_draw_sample_points (GimpDisplayShell *shell,
|
2010-08-12 19:13:15 +08:00
|
|
|
cairo_t *cr)
|
2005-03-05 08:10:40 +08:00
|
|
|
{
|
2009-10-07 01:20:44 +08:00
|
|
|
GimpImage *image;
|
|
|
|
|
2005-03-05 08:10:40 +08:00
|
|
|
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
2010-08-12 19:13:15 +08:00
|
|
|
g_return_if_fail (cr != NULL);
|
2005-03-05 08:10:40 +08:00
|
|
|
|
2009-10-07 01:20:44 +08:00
|
|
|
image = gimp_display_get_image (shell->display);
|
|
|
|
|
|
|
|
if (image && gimp_display_shell_get_show_sample_points (shell))
|
2005-03-05 08:10:40 +08:00
|
|
|
{
|
2010-08-12 19:13:15 +08:00
|
|
|
GList *list;
|
2005-03-05 08:10:40 +08:00
|
|
|
|
2009-10-07 01:20:44 +08:00
|
|
|
for (list = gimp_image_get_sample_points (image);
|
2005-03-05 08:10:40 +08:00
|
|
|
list;
|
|
|
|
list = g_list_next (list))
|
2006-04-12 20:49:29 +08:00
|
|
|
{
|
2010-08-12 19:13:15 +08:00
|
|
|
gimp_display_shell_draw_sample_point (shell, cr, list->data, FALSE);
|
2006-04-12 20:49:29 +08:00
|
|
|
}
|
2005-03-05 08:10:40 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-08-25 00:07:31 +08:00
|
|
|
void
|
|
|
|
gimp_display_shell_draw_layer_boundary (GimpDisplayShell *shell,
|
|
|
|
cairo_t *cr,
|
|
|
|
GimpDrawable *drawable,
|
2010-08-26 03:21:16 +08:00
|
|
|
GdkSegment *segs,
|
2010-08-25 00:07:31 +08:00
|
|
|
gint n_segs)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
|
|
|
g_return_if_fail (cr != NULL);
|
|
|
|
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
|
|
|
|
g_return_if_fail (segs != NULL && n_segs == 4);
|
|
|
|
|
|
|
|
gimp_display_shell_set_layer_style (shell, cr, drawable);
|
|
|
|
|
2010-08-27 20:58:43 +08:00
|
|
|
gimp_cairo_add_segments (cr, segs, n_segs);
|
2010-08-27 00:09:33 +08:00
|
|
|
cairo_stroke (cr);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_display_shell_draw_selection_out (GimpDisplayShell *shell,
|
|
|
|
cairo_t *cr,
|
|
|
|
GdkSegment *segs,
|
|
|
|
gint n_segs)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
|
|
|
g_return_if_fail (cr != NULL);
|
|
|
|
g_return_if_fail (segs != NULL && n_segs > 0);
|
|
|
|
|
|
|
|
gimp_display_shell_set_selection_out_style (shell, cr);
|
|
|
|
|
2010-08-27 20:58:43 +08:00
|
|
|
gimp_cairo_add_segments (cr, segs, n_segs);
|
2010-08-27 00:09:33 +08:00
|
|
|
cairo_stroke (cr);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2010-08-27 21:03:03 +08:00
|
|
|
gimp_display_shell_draw_selection_in (GimpDisplayShell *shell,
|
|
|
|
cairo_t *cr,
|
|
|
|
cairo_pattern_t *mask,
|
|
|
|
gint index)
|
2010-08-27 02:52:52 +08:00
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
|
|
|
g_return_if_fail (cr != NULL);
|
|
|
|
g_return_if_fail (mask != NULL);
|
|
|
|
|
|
|
|
gimp_display_shell_set_selection_in_style (shell, cr, index);
|
|
|
|
|
|
|
|
cairo_mask (cr, mask);
|
|
|
|
}
|
|
|
|
|
2003-09-12 06:24:30 +08:00
|
|
|
void
|
2009-10-25 03:02:19 +08:00
|
|
|
gimp_display_shell_draw_vector (GimpDisplayShell *shell,
|
|
|
|
GimpVectors *vectors)
|
2003-09-12 06:24:30 +08:00
|
|
|
{
|
2003-11-10 09:10:46 +08:00
|
|
|
GimpStroke *stroke = NULL;
|
2003-09-12 06:24:30 +08:00
|
|
|
|
|
|
|
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
|
|
|
g_return_if_fail (GIMP_IS_VECTORS (vectors));
|
|
|
|
|
|
|
|
while ((stroke = gimp_vectors_stroke_get_next (vectors, stroke)))
|
|
|
|
{
|
|
|
|
GArray *coords;
|
|
|
|
gboolean closed;
|
|
|
|
|
|
|
|
coords = gimp_stroke_interpolate (stroke, 1.0, &closed);
|
|
|
|
|
2006-08-09 21:40:21 +08:00
|
|
|
if (coords && coords->len > 0)
|
2003-09-12 06:24:30 +08:00
|
|
|
{
|
2006-08-09 21:40:21 +08:00
|
|
|
GdkPoint *gdk_coords = g_new (GdkPoint, coords->len);
|
2003-09-12 06:24:30 +08:00
|
|
|
|
2006-08-09 21:40:21 +08:00
|
|
|
gimp_display_shell_transform_coords (shell,
|
|
|
|
&g_array_index (coords,
|
|
|
|
GimpCoords, 0),
|
|
|
|
gdk_coords,
|
|
|
|
coords->len,
|
2004-03-21 05:59:41 +08:00
|
|
|
FALSE);
|
2003-09-12 06:24:30 +08:00
|
|
|
|
2003-11-11 03:35:56 +08:00
|
|
|
gimp_canvas_draw_lines (GIMP_CANVAS (shell->canvas),
|
|
|
|
GIMP_CANVAS_STYLE_XOR,
|
|
|
|
gdk_coords, coords->len);
|
2003-09-12 06:24:30 +08:00
|
|
|
|
|
|
|
g_free (gdk_coords);
|
|
|
|
}
|
|
|
|
|
2003-09-12 18:04:37 +08:00
|
|
|
if (coords)
|
|
|
|
g_array_free (coords, TRUE);
|
2003-09-12 06:24:30 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2009-10-25 03:02:19 +08:00
|
|
|
gimp_display_shell_draw_vectors (GimpDisplayShell *shell)
|
2003-09-12 06:24:30 +08:00
|
|
|
{
|
2009-10-07 01:20:44 +08:00
|
|
|
GimpImage *image;
|
|
|
|
|
2003-09-12 06:24:30 +08:00
|
|
|
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
|
|
|
|
2009-10-07 01:20:44 +08:00
|
|
|
image = gimp_display_get_image (shell->display);
|
|
|
|
|
|
|
|
if (image && TRUE /* gimp_display_shell_get_show_vectors (shell) */)
|
2003-09-12 06:24:30 +08:00
|
|
|
{
|
2009-08-02 05:07:07 +08:00
|
|
|
GList *all_vectors;
|
2003-09-12 06:24:30 +08:00
|
|
|
GList *list;
|
|
|
|
|
2009-10-07 01:20:44 +08:00
|
|
|
all_vectors = gimp_image_get_vectors_list (image);
|
2009-08-02 05:07:07 +08:00
|
|
|
|
|
|
|
for (list = all_vectors; list; list = list->next)
|
2006-04-12 20:49:29 +08:00
|
|
|
{
|
2003-09-12 06:24:30 +08:00
|
|
|
GimpVectors *vectors = list->data;
|
|
|
|
|
|
|
|
if (gimp_item_get_visible (GIMP_ITEM (vectors)))
|
|
|
|
gimp_display_shell_draw_vector (shell, vectors);
|
2006-04-12 20:49:29 +08:00
|
|
|
}
|
2009-08-02 05:07:07 +08:00
|
|
|
|
|
|
|
g_list_free (all_vectors);
|
2003-09-12 06:24:30 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-02-07 08:16:52 +08:00
|
|
|
void
|
2010-08-24 02:39:22 +08:00
|
|
|
gimp_display_shell_draw_cursor (GimpDisplayShell *shell,
|
|
|
|
cairo_t *cr)
|
2004-02-07 08:16:52 +08:00
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
2010-08-24 02:39:22 +08:00
|
|
|
g_return_if_fail (cr != NULL);
|
2004-02-07 08:16:52 +08:00
|
|
|
|
|
|
|
if (shell->have_cursor)
|
2010-08-24 02:39:22 +08:00
|
|
|
{
|
|
|
|
gimp_display_shell_set_cursor_style (shell, cr);
|
2010-08-25 19:01:12 +08:00
|
|
|
cairo_translate (cr, 0.5, 0.5);
|
2010-08-24 02:39:22 +08:00
|
|
|
|
|
|
|
cairo_set_source_rgb (cr, 1.0, 1.0, 1.0);
|
|
|
|
|
2010-08-27 01:13:49 +08:00
|
|
|
cairo_move_to (cr, shell->cursor_x - GIMP_CURSOR_SIZE, shell->cursor_y - 1);
|
|
|
|
cairo_line_to (cr, shell->cursor_x + GIMP_CURSOR_SIZE, shell->cursor_y - 1);
|
2010-08-24 02:39:22 +08:00
|
|
|
|
2010-08-27 01:13:49 +08:00
|
|
|
cairo_move_to (cr, shell->cursor_x - GIMP_CURSOR_SIZE, shell->cursor_y + 1);
|
|
|
|
cairo_line_to (cr, shell->cursor_x + GIMP_CURSOR_SIZE, shell->cursor_y + 1);
|
2010-08-24 02:39:22 +08:00
|
|
|
|
2010-08-27 01:13:49 +08:00
|
|
|
cairo_move_to (cr, shell->cursor_x - 1, shell->cursor_y - GIMP_CURSOR_SIZE);
|
|
|
|
cairo_line_to (cr, shell->cursor_x - 1, shell->cursor_y + GIMP_CURSOR_SIZE);
|
2010-08-24 02:39:22 +08:00
|
|
|
|
2010-08-27 01:13:49 +08:00
|
|
|
cairo_move_to (cr, shell->cursor_x + 1, shell->cursor_y - GIMP_CURSOR_SIZE);
|
|
|
|
cairo_line_to (cr, shell->cursor_x + 1, shell->cursor_y + GIMP_CURSOR_SIZE);
|
2010-08-24 02:39:22 +08:00
|
|
|
|
|
|
|
cairo_stroke (cr);
|
|
|
|
|
|
|
|
cairo_set_source_rgb (cr, 0.0, 0.0, 0.0);
|
|
|
|
|
2010-08-27 01:13:49 +08:00
|
|
|
cairo_move_to (cr, shell->cursor_x - GIMP_CURSOR_SIZE, shell->cursor_y);
|
|
|
|
cairo_line_to (cr, shell->cursor_x + GIMP_CURSOR_SIZE, shell->cursor_y);
|
2010-08-24 02:39:22 +08:00
|
|
|
|
2010-08-27 01:13:49 +08:00
|
|
|
cairo_move_to (cr, shell->cursor_x, shell->cursor_y - GIMP_CURSOR_SIZE);
|
|
|
|
cairo_line_to (cr, shell->cursor_x, shell->cursor_y + GIMP_CURSOR_SIZE);
|
2010-08-24 02:39:22 +08:00
|
|
|
|
|
|
|
cairo_stroke (cr);
|
|
|
|
}
|
2004-02-07 08:16:52 +08:00
|
|
|
}
|
|
|
|
|
2003-02-21 20:16:43 +08:00
|
|
|
void
|
2009-10-25 03:02:19 +08:00
|
|
|
gimp_display_shell_draw_area (GimpDisplayShell *shell,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint w,
|
|
|
|
gint h)
|
2001-11-01 05:20:09 +08:00
|
|
|
{
|
2010-05-02 19:08:11 +08:00
|
|
|
GdkRectangle rect;
|
|
|
|
gint x2, y2;
|
|
|
|
gint i, j;
|
2007-06-06 21:45:44 +08:00
|
|
|
|
2008-03-19 05:22:21 +08:00
|
|
|
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
2010-05-02 19:08:11 +08:00
|
|
|
g_return_if_fail (gimp_display_get_image (shell->display));
|
2008-03-19 05:22:21 +08:00
|
|
|
|
2010-05-02 19:08:11 +08:00
|
|
|
x2 = x + w;
|
|
|
|
y2 = y + h;
|
2008-11-14 07:16:11 +08:00
|
|
|
|
2010-05-02 19:08:11 +08:00
|
|
|
if (shell->highlight)
|
|
|
|
{
|
|
|
|
rect.x = ceil (shell->scale_x * shell->highlight->x);
|
|
|
|
rect.y = ceil (shell->scale_y * shell->highlight->y);
|
|
|
|
rect.width = floor (shell->scale_x * shell->highlight->width);
|
|
|
|
rect.height = floor (shell->scale_y * shell->highlight->height);
|
|
|
|
}
|
2004-02-07 09:41:30 +08:00
|
|
|
|
2010-05-02 19:08:11 +08:00
|
|
|
/* display the image in RENDER_BUF_WIDTH x RENDER_BUF_HEIGHT
|
|
|
|
* sized chunks
|
2004-02-07 09:41:30 +08:00
|
|
|
*/
|
2010-05-02 19:08:11 +08:00
|
|
|
for (i = y; i < y2; i += GIMP_DISPLAY_RENDER_BUF_HEIGHT)
|
2004-02-07 09:41:30 +08:00
|
|
|
{
|
2010-05-02 19:08:11 +08:00
|
|
|
for (j = x; j < x2; j += GIMP_DISPLAY_RENDER_BUF_WIDTH)
|
2004-10-01 17:50:04 +08:00
|
|
|
{
|
2010-05-02 19:08:11 +08:00
|
|
|
gint disp_xoffset, disp_yoffset;
|
|
|
|
gint dx, dy;
|
2004-10-01 17:50:04 +08:00
|
|
|
|
2010-05-02 19:08:11 +08:00
|
|
|
dx = MIN (x2 - j, GIMP_DISPLAY_RENDER_BUF_WIDTH);
|
|
|
|
dy = MIN (y2 - i, GIMP_DISPLAY_RENDER_BUF_HEIGHT);
|
2004-02-07 09:41:30 +08:00
|
|
|
|
2010-05-02 19:08:11 +08:00
|
|
|
gimp_display_shell_scroll_get_disp_offset (shell,
|
|
|
|
&disp_xoffset,
|
|
|
|
&disp_yoffset);
|
2001-11-01 05:20:09 +08:00
|
|
|
|
2010-05-02 19:08:11 +08:00
|
|
|
gimp_display_shell_render (shell,
|
|
|
|
j - disp_xoffset,
|
|
|
|
i - disp_yoffset,
|
|
|
|
dx, dy,
|
|
|
|
shell->highlight ? &rect : NULL);
|
2001-11-01 05:20:09 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|