text = document.getCharsSequence();
JViewport viewport = editor.getScrollPane().getViewport();
double viewportY = viewport.getViewPosition().getY();
ScrollingModelImpl scrollingModel = (ScrollingModelImpl) editor.getScrollingModel();
visibleArea = scrollingModel.getVisibleArea();
double height = visibleArea.getHeight();
//TODO: Can this be more accurate?
double linesAbove = viewportY / editor.getLineHeight();
height += editor.getLineHeight() * 4;