Case shifter
[jalview.git] / src / jalview / appletgui / SeqCanvas.java
index 465dd38..c5b4324 100755 (executable)
@@ -37,12 +37,13 @@ public class SeqCanvas
 \r
   SearchResults searchResults = null;\r
 \r
-  int chunkHeight;\r
-  int chunkWidth;\r
-\r
   boolean fastPaint = false;\r
 \r
 \r
+  int cursorX = 0;\r
+  int cursorY = 0;\r
+\r
+\r
   public SeqCanvas(AlignViewport av)\r
   {\r
     this.av = av;\r
@@ -140,7 +141,7 @@ public class SeqCanvas
           continue;\r
         }\r
 \r
-        value = av.alignment.getSequenceAt(i).findPosition(index);\r
+        value = seq.findPosition(index);\r
         break;\r
       }\r
       if (value != -1)\r
@@ -365,7 +366,7 @@ public class SeqCanvas
 \r
     while ((ypos <= canvasHeight) && (startRes < av.alignment.getWidth()))\r
     {\r
-      endx = startRes + cWidth;\r
+      endx = startRes + cWidth -1;\r
 \r
       if (endx > al.getWidth())\r
       {\r
@@ -406,7 +407,7 @@ public class SeqCanvas
           if(annotations==null)\r
             annotations = new AnnotationPanel(av);\r
 \r
-          annotations.drawComponent( g, startRes, endx );\r
+          annotations.drawComponent( g, startRes, endx+1 );\r
           g.translate(0, -cHeight - ypos-4);\r
         }\r
         g.translate(-LABEL_WEST, 0);\r
@@ -468,6 +469,14 @@ public class SeqCanvas
                                 av.charWidth, av.charHeight);\r
        }\r
    }\r
+\r
+   if (av.cursorMode && cursorY == i\r
+       && cursorX >= startRes && cursorX <= endRes)\r
+   {\r
+     sr.drawCursor(nextSeq, cursorX, (cursorX - startRes) * av.charWidth,\r
+                   offset + ( (i - startSeq) * av.charHeight));\r
+   }\r
+\r
   }\r
 \r
   //\r