Commits

equalsraf committed 21b45f6

Fix VimWrapper::mapBlock(): remove extra pixel

- mapBlock() is supposed to return the rectangle coordinates that
contain a set of lines/columns, as a pixel QRect, but it was returning
an extra pixel at the bottom.
* Issue#79

  • Participants
  • Parent commits 2b2d9db

Comments (0)

Files changed (1)

src/qt/vimwrapper.cpp

 	}
 }
 
-
+/**
+ * Map row/column into absolute pixel coordinates
+ *
+ * The returned point is the top left corner of the cell
+ *
+ */
 QPoint VimWrapper::mapText(int row, int col) 
 { 
 	return QPoint( gui.char_width*col, gui.char_height*row );
 	return mapText(gui.cursor_row, gui.cursor_col);
 }
 
+/**
+ * Return a rect from row1/col1 to row2/col2 (inclusive)
+ *
+ * The rect coordinates are in pixels
+ */
 QRect VimWrapper::mapBlock(int row1, int col1, int row2, int col2)
 {
 	QPoint tl = mapText( row1, col1 );
 	QPoint br = mapText( row2+1, col2+1);
 	br.setX( br.x()-1 );
-	br.setY( br.y() );
+	br.setY( br.y()-1 );
 
 	return QRect(tl, br);
 }