Commits

Marko Toplak committed ce80444

Fixed selection of the cell borders in OWHeatMap. Fixes #1336

Comments (0)

Files changed (1)

orangecontrib/bio/widgets/OWHeatMap.py

         pos = self.mapToItem(self.heatmap_item.pixmap_item, pos)
         x, y = pos.x(), pos.y()
         def clamp(i, m):
-            return int(min(max(i, 0), m))
+            return int(min(max(i, 0), m-1))
         return (clamp(math.floor(y / self.cell_height), self.heatmap.height),
                 clamp(math.floor(x / self.cell_width), self.heatmap.width))
     
             rows2hm = self.rows_to_heatmaps()
             selections = iter(selections)
             start = end = selections.next()
-            end_heatmaps= rows2hm[end]
+            end_heatmaps = rows2hm[end]
             try:
                 while True:
                     new_end = selections.next()
                 rect |= heatmap.mapToScene(heatmap.row_rect(start - h_start)).boundingRect()
                 rect |= heatmap.mapToScene(heatmap.row_rect(end - h_start)).boundingRect()
             return rect
-                 
+             
         self.selection_rects = []
         for start, end, heatmaps in group_selections(self.selections):
             rect = selection_rect(start, end, heatmaps)