Skip to content

Commit

Permalink
[tests] Fix measuring of editor bottom in case of zero-width scrollbars
Browse files Browse the repository at this point in the history
Issue #3517
  • Loading branch information
marijnh committed Oct 30, 2015
1 parent a11ccbe commit 38131c4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/scroll_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
function barV(cm) { return byClassName(cm.getWrapperElement(), "CodeMirror-vscrollbar")[0]; }

function displayBottom(cm, scrollbar) {
if (scrollbar)
if (scrollbar && cm.display.scroller.offsetHeight > cm.display.scroller.clientHeight)
return barH(cm).getBoundingClientRect().top;
else
return cm.getWrapperElement().getBoundingClientRect().bottom - 1;
}

function displayRight(cm, scrollbar) {
if (scrollbar)
if (scrollbar && cm.display.scroller.offsetWidth > cm.display.scroller.clientWidth)
return barV(cm).getBoundingClientRect().left;
else
return cm.getWrapperElement().getBoundingClientRect().right - 1;
Expand Down

0 comments on commit 38131c4

Please sign in to comment.