Skip to content
Snippets Groups Projects
Commit 2ded79e9 authored by rds's avatar rds
Browse files

Fix RT Ticket 55131 (Problems with marking when reverse complementing)

parent 0a0b04bc
No related branches found
No related tags found
No related merge requests found
......@@ -26,9 +26,9 @@
*
* Exported functions: See zmapWindow_P.h
* HISTORY:
* Last edited: Apr 24 11:31 2008 (edgrif)
* Last edited: May 13 11:07 2008 (rds)
* Created: Thu Sep 8 10:37:24 2005 (edgrif)
* CVS info: $Id: zmapWindowItem.c,v 1.98 2008-04-24 12:55:40 edgrif Exp $
* CVS info: $Id: zmapWindowItem.c,v 1.99 2008-05-13 10:16:34 rds Exp $
*-------------------------------------------------------------------
*/
......@@ -1614,6 +1614,8 @@ gboolean zmapWindowWorld2SeqCoords(ZMapWindow window,
else
{
get_item_at_workaround_struct workaround_struct = {NULL};
double scroll_x2;
FooCanvasItem *cont_root = zmapWindowFToIFindItemFull(window->context_to_item, 0, 0, 0, 0, 0, 0);
workaround_struct.wx1 = wx1;
......@@ -1624,6 +1626,16 @@ gboolean zmapWindowWorld2SeqCoords(ZMapWindow window,
/* For some reason foo_canvas_get_item_at() fails to find items
* a lot of the time even when it shouldn't and so we need a solution. */
/* Incidentally some of the time, for some users, so does this. (RT # 55131) */
/* The cause: if the mark is > 10% out of the scroll region the threshold (90%)
* for intersection will not be met. So I'm going to clamp to the scroll
* region and lower the threshold to 55%...
*/
zmapWindowGetScrollRegion(window, NULL, NULL, &scroll_x2, NULL);
if(workaround_struct.wx2 > scroll_x2)
workaround_struct.wx2 = scroll_x2;
zmapWindowContainerExecute(FOO_CANVAS_GROUP(cont_root), ZMAPCONTAINER_LEVEL_BLOCK, fill_workaround_struct, &workaround_struct);
if((result = workaround_struct.result))
......@@ -2332,7 +2344,7 @@ static void fill_workaround_struct(FooCanvasGroup *container,
&(area_block.x2), &(area_block.y2));
if((workaround->wx1 >= area_block.x1 && workaround->wx2 <= area_block.x2 &&
workaround->wy1 >= area_block.y1 && workaround->wy2 <= area_block.y2) ||
areas_intersect_gt_threshold(&area_src, &area_block, 0.9))
areas_intersect_gt_threshold(&area_src, &area_block, 0.55))
{
/* We're inside */
workaround->block = container;
......
......@@ -27,9 +27,9 @@
*
* Exported functions: See zmapWindow_P.h
* HISTORY:
* Last edited: Mar 12 09:15 2008 (edgrif)
* Last edited: May 13 11:14 2008 (rds)
* Created: Tue Jan 16 09:51:19 2007 (rds)
* CVS info: $Id: zmapWindowMark.c,v 1.12 2008-03-12 09:15:34 edgrif Exp $
* CVS info: $Id: zmapWindowMark.c,v 1.13 2008-05-13 10:16:23 rds Exp $
*-------------------------------------------------------------------
*/
......@@ -228,6 +228,7 @@ gboolean zmapWindowMarkSetWorldRange(ZMapWindowMark mark,
{
gboolean result ;
FooCanvasGroup *block_grp_out ;
double scroll_x2;
int y1_out, y2_out ;
zMapAssert(mark && ZMAP_MAGIC_IS_VALID(mark_magic_G, mark->magic)) ;
......@@ -235,10 +236,17 @@ gboolean zmapWindowMarkSetWorldRange(ZMapWindowMark mark,
zmapWindowMarkReset(mark) ;
y1_out = y2_out = 0 ;
/* clamp x to scroll region. Fix RT # 55131 */
zmapWindowGetScrollRegion(mark->window, NULL, NULL, &scroll_x2, NULL);
if(world_x2 > scroll_x2)
world_x2 = scroll_x2;
if ((result = zmapWindowWorld2SeqCoords(mark->window, world_x1, world_y1, world_x2, world_y2,
&block_grp_out, &y1_out, &y2_out)))
{
double y1, y2, dummy ;
double y1, y2, dummy;
mark->block_group = block_grp_out ;
mark->block = g_object_get_data(G_OBJECT(mark->block_group), ITEM_FEATURE_DATA) ;
......
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