Skip to content

Commit

Permalink
Fix bug when scrolling past a booked cell
Browse files Browse the repository at this point in the history
  • Loading branch information
campbell-m committed Oct 24, 2024
1 parent 8757998 commit f5b64b5
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions web/js/resizable.js.php
Original file line number Diff line number Diff line change
Expand Up @@ -852,14 +852,22 @@ function getDataName(jqObject)

if (xDelta || yDelta)
{
downHandler.firstPosition.x -= xDelta;
downHandler.firstPosition.y -= yDelta;
Table.scrollContainerBy(xDelta, yDelta);
<?php
// Need to resize the table after a scroll because the coordinates
// of the grid lines and booked cells will have changed.
// TODO: Optimise performance by just recording the cumulative x- and
// TODO: y-deltas and then use those in snapToGrid() etc.?
?>
Table.size();
<?php
// Because we've scrolled we need to correct the positions of
// downHandler.firstPosition and oldBoxOffset.
?>
downHandler.firstPosition.x -= xDelta;
downHandler.firstPosition.y -= yDelta;
oldBoxOffset.left -= xDelta;
oldBoxOffset.top -= yDelta;
}

<?php // Otherwise redraw the box ?>
Expand Down

0 comments on commit f5b64b5

Please sign in to comment.