Commit be17b30b authored by BST 2000 Andy Thomas's avatar BST 2000 Andy Thomas Committed by Andy Thomas
Browse files

app/edit_selection.c


Tue Jun 13 22:38:22 BST 2000 Andy Thomas <alt@gimp.org>

	* app/edit_selection.c

	Fixed problem with selection outline. The outline drawing did not
	take acount of the display offset so that if you moved a selection
	to the edge of an image that cause the image to scroll in the viewing
	window the section outline was drawn incorrectly.
parent c485463e
Tue Jun 13 22:38:22 BST 2000 Andy Thomas <alt@gimp.org>
* app/edit_selection.c
Fixed problem with selection outline. The outline drawing did not
take acount of the display offset so that if you moved a selection
to the edge of an image that cause the image to scroll in the viewing
window the section outline was drawn incorrectly.
2000-06-13 Jay Cox <jaycox@gimp.org>
 
* tools/pdbgen/pdb/help.pdb, app/help_cmds.c:
......
......@@ -47,6 +47,7 @@ struct _EditSelection
{
gint origx, origy; /* last x and y coords */
gint cumlx, cumly; /* cumulative changes to x and yed */
gint offset_x,offset_y; /* Offset of display at start sel */
gint x, y; /* current x and y coords */
gint x1, y1; /* bounding box of selection mask */
......@@ -132,6 +133,9 @@ init_edit_selection (Tool *tool,
edit_select.cumlx = 0;
edit_select.cumly = 0;
edit_select.offset_x = gdisp->offset_x;
edit_select.offset_y = gdisp->offset_y;
/* Make a check to see if it should be a floating selection translation */
if (edit_type == MaskToLayerTranslate && gimage_floating_sel (gdisp->gimage))
edit_type = FloatingSelTranslate;
......@@ -571,8 +575,9 @@ edit_selection_draw (Tool *tool)
break;
case FloatingSelTranslate:
diff_x = SCALEX (gdisp, edit_select.cumlx);
diff_y = SCALEY (gdisp, edit_select.cumly);
diff_x = SCALEX (gdisp, edit_select.cumlx) - gdisp->offset_x + edit_select.offset_x;
diff_y = SCALEY (gdisp, edit_select.cumly) - gdisp->offset_y + edit_select.offset_y;
seg = select->segs_in;
for (i = 0; i < select->num_segs_in; i++)
......
......@@ -47,6 +47,7 @@ struct _EditSelection
{
gint origx, origy; /* last x and y coords */
gint cumlx, cumly; /* cumulative changes to x and yed */
gint offset_x,offset_y; /* Offset of display at start sel */
gint x, y; /* current x and y coords */
gint x1, y1; /* bounding box of selection mask */
......@@ -132,6 +133,9 @@ init_edit_selection (Tool *tool,
edit_select.cumlx = 0;
edit_select.cumly = 0;
edit_select.offset_x = gdisp->offset_x;
edit_select.offset_y = gdisp->offset_y;
/* Make a check to see if it should be a floating selection translation */
if (edit_type == MaskToLayerTranslate && gimage_floating_sel (gdisp->gimage))
edit_type = FloatingSelTranslate;
......@@ -571,8 +575,9 @@ edit_selection_draw (Tool *tool)
break;
case FloatingSelTranslate:
diff_x = SCALEX (gdisp, edit_select.cumlx);
diff_y = SCALEY (gdisp, edit_select.cumly);
diff_x = SCALEX (gdisp, edit_select.cumlx) - gdisp->offset_x + edit_select.offset_x;
diff_y = SCALEY (gdisp, edit_select.cumly) - gdisp->offset_y + edit_select.offset_y;
seg = select->segs_in;
for (i = 0; i < select->num_segs_in; i++)
......
......@@ -47,6 +47,7 @@ struct _EditSelection
{
gint origx, origy; /* last x and y coords */
gint cumlx, cumly; /* cumulative changes to x and yed */
gint offset_x,offset_y; /* Offset of display at start sel */
gint x, y; /* current x and y coords */
gint x1, y1; /* bounding box of selection mask */
......@@ -132,6 +133,9 @@ init_edit_selection (Tool *tool,
edit_select.cumlx = 0;
edit_select.cumly = 0;
edit_select.offset_x = gdisp->offset_x;
edit_select.offset_y = gdisp->offset_y;
/* Make a check to see if it should be a floating selection translation */
if (edit_type == MaskToLayerTranslate && gimage_floating_sel (gdisp->gimage))
edit_type = FloatingSelTranslate;
......@@ -571,8 +575,9 @@ edit_selection_draw (Tool *tool)
break;
case FloatingSelTranslate:
diff_x = SCALEX (gdisp, edit_select.cumlx);
diff_y = SCALEY (gdisp, edit_select.cumly);
diff_x = SCALEX (gdisp, edit_select.cumlx) - gdisp->offset_x + edit_select.offset_x;
diff_y = SCALEY (gdisp, edit_select.cumly) - gdisp->offset_y + edit_select.offset_y;
seg = select->segs_in;
for (i = 0; i < select->num_segs_in; i++)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment