Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix for dragging feature ends using SHIFT

  • Loading branch information...
commit eca578cb8d63f2b36c68fad206779e7ca4b799b1 1 parent 9336390
tcarver authored
Showing with 19 additions and 14 deletions.
  1. +19 −14 uk/ac/sanger/artemis/components/FeatureDisplay.java
View
33 uk/ac/sanger/artemis/components/FeatureDisplay.java
@@ -4296,21 +4296,26 @@ private void handleCanvasSingleClick(MouseEvent event)
{
if(event.isShiftDown())
{
- if(new_click_range.getStart().getPosition() >= this_segment.getStart().getPosition() &&
- new_click_range.getStart().getPosition() <= this_segment.getStart().getPosition()+60)
+ if( (new_click_range.getStart().getPosition() >= this_segment.getStart().getPosition() &&
+ new_click_range.getStart().getPosition() <= this_segment.getStart().getPosition()+60) ||
+ (new_click_range.getEnd().getPosition() <= this_segment.getEnd().getPosition() &&
+ new_click_range.getEnd().getPosition() >= this_segment.getEnd().getPosition()-60) )
{
- click_segment_marker = this_segment.getStart();
- click_segment_marker_is_start_marker = true;
- other_end_of_segment_marker = this_segment.getEnd();
- getEntryGroup().getActionController().startAction();
- break;
- }
- else if(new_click_range.getEnd().getPosition() <= this_segment.getEnd().getPosition() &&
- new_click_range.getEnd().getPosition() >= this_segment.getEnd().getPosition()-60)
- {
- click_segment_marker = this_segment.getEnd();
- click_segment_marker_is_start_marker = false;
- other_end_of_segment_marker = this_segment.getStart();
+ int distFromBeg = new_click_range.getStart().getPosition()-this_segment.getStart().getPosition();
+ int distFromEnd = this_segment.getEnd().getPosition()-new_click_range.getEnd().getPosition();
+ if(distFromBeg < distFromEnd)
+ {
+ click_segment_marker = this_segment.getStart();
+ click_segment_marker_is_start_marker = true;
+ other_end_of_segment_marker = this_segment.getEnd();
+ }
+ else
+ {
+ click_segment_marker = this_segment.getEnd();
+ click_segment_marker_is_start_marker = false;
+ other_end_of_segment_marker = this_segment.getStart();
+ }
+
getEntryGroup().getActionController().startAction();
break;
}
Please sign in to comment.
Something went wrong with that request. Please try again.