Offset brush buffer when painting on edges of the canvas. Set window to

Fri Mar 26 03:13:15 EST 1998 Matthew Wilson <msw@gimp.org>
	* app/paint_core.c: Offset brush buffer when painting on edges
	of the canvas.
	* app/text_tool.c: Set window to auto_shrink = FALSE

-Matt
This commit is contained in:
EST 1998 Matthew Wilson 1998-03-27 08:13:45 +00:00 committed by Matt Wilson
parent 2bdb815447
commit 57c8796d53
6 changed files with 32 additions and 2 deletions

View File

@ -1,3 +1,8 @@
Fri Mar 26 03:13:15 EST 1998 Matthew Wilson <msw@gimp.org>
* app/paint_core.c: Offset brush buffer when painting on edges
of the canvas.
* app/text_tool.c: Set window to auto_shrink = FALSE
Fri Mar 26 01:30:45 EST 1998 Matthew Wilson <msw@gimp.org>
* app/iscissors.c
* app/bezier_select.c: Change to select the bezier tool properly

View File

@ -999,6 +999,14 @@ paint_to_canvas_buf (paint_core, brush_mask, brush_opacity)
int brush_opacity;
{
PixelRegion srcPR, maskPR;
int x, y;
int xoff, yoff;
x = (int) paint_core->curx - (brush_mask->width >> 1);
y = (int) paint_core->cury - (brush_mask->height >> 1);
xoff = (x < 0) ? -x : 0;
yoff = (y < 0) ? -y : 0;
/* combine the canvas buf and the brush mask to the canvas buf */
srcPR.bytes = canvas_buf->bytes;
@ -1013,7 +1021,7 @@ paint_to_canvas_buf (paint_core, brush_mask, brush_opacity)
maskPR.w = srcPR.w;
maskPR.h = srcPR.h;
maskPR.rowstride = maskPR.bytes * brush_mask->width;
maskPR.data = mask_buf_data (brush_mask);
maskPR.data = mask_buf_data (brush_mask) + yoff * maskPR.rowstride + xoff * maskPR.bytes;
/* apply the mask */
apply_mask_to_region (&srcPR, &maskPR, brush_opacity);

View File

@ -422,6 +422,9 @@ text_create_dialog (TextTool *text_tool)
gtk_window_set_title (GTK_WINDOW (text_tool->shell), "Text Tool");
gtk_window_set_policy (GTK_WINDOW (text_tool->shell), FALSE, TRUE, TRUE);
gtk_window_position (GTK_WINDOW (text_tool->shell), GTK_WIN_POS_MOUSE);
gtk_widget_set (GTK_WIDGET (text_tool->shell),
"GtkWindow::auto_shrink", FALSE,
NULL);
/* handle the wm close signal */
gtk_signal_connect (GTK_OBJECT (text_tool->shell), "delete_event",

View File

@ -422,6 +422,9 @@ text_create_dialog (TextTool *text_tool)
gtk_window_set_title (GTK_WINDOW (text_tool->shell), "Text Tool");
gtk_window_set_policy (GTK_WINDOW (text_tool->shell), FALSE, TRUE, TRUE);
gtk_window_position (GTK_WINDOW (text_tool->shell), GTK_WIN_POS_MOUSE);
gtk_widget_set (GTK_WIDGET (text_tool->shell),
"GtkWindow::auto_shrink", FALSE,
NULL);
/* handle the wm close signal */
gtk_signal_connect (GTK_OBJECT (text_tool->shell), "delete_event",

View File

@ -999,6 +999,14 @@ paint_to_canvas_buf (paint_core, brush_mask, brush_opacity)
int brush_opacity;
{
PixelRegion srcPR, maskPR;
int x, y;
int xoff, yoff;
x = (int) paint_core->curx - (brush_mask->width >> 1);
y = (int) paint_core->cury - (brush_mask->height >> 1);
xoff = (x < 0) ? -x : 0;
yoff = (y < 0) ? -y : 0;
/* combine the canvas buf and the brush mask to the canvas buf */
srcPR.bytes = canvas_buf->bytes;
@ -1013,7 +1021,7 @@ paint_to_canvas_buf (paint_core, brush_mask, brush_opacity)
maskPR.w = srcPR.w;
maskPR.h = srcPR.h;
maskPR.rowstride = maskPR.bytes * brush_mask->width;
maskPR.data = mask_buf_data (brush_mask);
maskPR.data = mask_buf_data (brush_mask) + yoff * maskPR.rowstride + xoff * maskPR.bytes;
/* apply the mask */
apply_mask_to_region (&srcPR, &maskPR, brush_opacity);

View File

@ -422,6 +422,9 @@ text_create_dialog (TextTool *text_tool)
gtk_window_set_title (GTK_WINDOW (text_tool->shell), "Text Tool");
gtk_window_set_policy (GTK_WINDOW (text_tool->shell), FALSE, TRUE, TRUE);
gtk_window_position (GTK_WINDOW (text_tool->shell), GTK_WIN_POS_MOUSE);
gtk_widget_set (GTK_WIDGET (text_tool->shell),
"GtkWindow::auto_shrink", FALSE,
NULL);
/* handle the wm close signal */
gtk_signal_connect (GTK_OBJECT (text_tool->shell), "delete_event",