Skip to content

Commit 3d77bb8

Browse files
author
angusforbes
committed
Fixes bug in dragRow, now keeps the rowpadding space correctly and finds
the row height properly.
1 parent 6e93221 commit 3d77bb8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

js/interact.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,7 @@ function dragRow(x, y, row) {
947947

948948
if (row.idx < rows.length - 1) {
949949

950-
nextY = (rows[row.idx + 1].lineBottom.bbox().y - wordHeight ) - (dragRectSide + dragRectMargin) - 5 ;
950+
nextY = (rows[row.idx + 1].lineBottom.bbox().y - wordHeight ) - (dragRectSide + dragRectMargin) - rowpadding/2 ;
951951

952952
if (y > nextY) {
953953
nextRowTooSmall = true;
@@ -957,7 +957,7 @@ function dragRow(x, y, row) {
957957
//check that this row is not smaller than the word size in the row
958958

959959
if (inc + dragRectSide + dragRectMargin < wordHeight) {
960-
row.bbox.height(wordHeight);
960+
row.rect.height(wordHeight);
961961
y = row.rect.bbox().y + row.rect.bbox().h - (dragRectSide + dragRectMargin);
962962
row.lineBottom.y(y + dragRectSide + dragRectMargin);
963963
} else if (row.idx < rows.length - 1 && nextRowTooSmall == true) { //check that this row is not expanding so large that it is bigger than the next row's smallest size
@@ -984,13 +984,13 @@ function dragRow(x, y, row) {
984984
if (row.idx < rows.length - 1) {
985985

986986
var nextrow = rows[row.idx + 1];
987-
nextrow.rect.y(row.rect.bbox().y + row.rect.bbox().h + 5);
988-
nextrow.rect.height( nextrow.dragRect.bbox().y - y - (5));
987+
nextrow.rect.y(row.rect.bbox().y + row.rect.bbox().h + rowpadding/2);
988+
nextrow.rect.height( nextrow.dragRect.bbox().y - y - (rowpadding/2));
989989

990990
nextrow.ry = nextrow.rect.y();
991991
nextrow.rh = nextrow.rect.height();
992992

993-
nextrow.lineTop.y(row.rect.bbox().y + row.rect.bbox().h + 5);
993+
nextrow.lineTop.y(row.rect.bbox().y + row.rect.bbox().h + rowpadding/2);
994994

995995
for (var i = 0; i < nextrow.words.length; i++) {
996996
//updateLinksOfWord(nextrow.words[i]);

0 commit comments

Comments
 (0)