@@ -158,7 +158,7 @@ describe("Viewport of Simple sheet", () => {
158158 expect ( model . getters . getActiveMainViewport ( ) ) . toMatchObject ( {
159159 left : 0 ,
160160 right : 10 ,
161- top : 59 ,
161+ top : 58 ,
162162 bottom : 99 ,
163163 } ) ;
164164 const { height } = model . getters . getMainViewportRect ( ) ;
@@ -171,8 +171,8 @@ describe("Viewport of Simple sheet", () => {
171171 expect ( model . getters . getActiveMainViewport ( ) ) . toMatchObject ( {
172172 left : 0 ,
173173 right : 10 ,
174- top : 59 ,
175- bottom : 103 ,
174+ top : 58 ,
175+ bottom : 101 ,
176176 } ) ;
177177 expect ( model . getters . getActiveSheetScrollInfo ( ) ) . toMatchObject ( {
178178 scrollX : 0 ,
@@ -214,15 +214,15 @@ describe("Viewport of Simple sheet", () => {
214214 scrollY : 0 ,
215215 } ) ;
216216
217- setViewportOffset ( model , DEFAULT_CELL_WIDTH * 16 , 0 ) ;
217+ setViewportOffset ( model , DEFAULT_CELL_WIDTH * 14 , 0 ) ;
218218 expect ( model . getters . getActiveMainViewport ( ) ) . toMatchObject ( {
219219 top : 0 ,
220220 bottom : 43 ,
221- left : 16 ,
222- right : 25 ,
221+ left : 14 ,
222+ right : 24 ,
223223 } ) ;
224224 expect ( model . getters . getActiveSheetScrollInfo ( ) ) . toMatchObject ( {
225- scrollX : DEFAULT_CELL_WIDTH * 16 ,
225+ scrollX : DEFAULT_CELL_WIDTH * 14 ,
226226 scrollY : 0 ,
227227 } ) ;
228228
@@ -269,15 +269,15 @@ describe("Viewport of Simple sheet", () => {
269269 right : 25 ,
270270 } ) ;
271271
272- setViewportOffset ( model , DEFAULT_CELL_WIDTH * 16 , 0 ) ;
272+ const { width : sheetViewWidth } = model . getters . getSheetViewDimension ( ) ;
273273 expect ( model . getters . getActiveMainViewport ( ) ) . toMatchObject ( {
274274 top : 5 ,
275275 bottom : 43 ,
276- left : 20 ,
276+ left : 19 ,
277277 right : 25 ,
278278 } ) ;
279279 expect ( model . getters . getActiveSheetScrollInfo ( ) ) . toMatchObject ( {
280- scrollX : DEFAULT_CELL_WIDTH * 16 ,
280+ scrollX : 26 * DEFAULT_CELL_WIDTH - sheetViewWidth , // fully scrolled
281281 scrollY : 0 ,
282282 } ) ;
283283 } ) ;
@@ -429,11 +429,11 @@ describe("Viewport of Simple sheet", () => {
429429 const nRows = model . getters . getNumberRows ( sheetId ) ;
430430 setViewportOffset ( model , nCols * DEFAULT_CELL_WIDTH + 10 , nRows * DEFAULT_CELL_HEIGHT + 10 ) ;
431431
432- const maxOffsetX = DEFAULT_CELL_WIDTH * ( nCols - 10 + 1 ) ;
433- const maxOffsetY = DEFAULT_CELL_HEIGHT * ( nRows - 10 + 1 ) + 46 ;
432+ const maxOffsetX = DEFAULT_CELL_WIDTH * ( nCols - 10 ) ;
433+ const maxOffsetY = DEFAULT_CELL_HEIGHT * ( nRows - 10 ) + 46 ;
434434 expect ( model . getters . getActiveSheetScrollInfo ( ) ) . toEqual ( {
435- scrollX : maxOffsetX + 1 ,
436- scrollY : maxOffsetY + 1 + 5 ,
435+ scrollX : maxOffsetX ,
436+ scrollY : maxOffsetY ,
437437 } ) ;
438438 } ) ;
439439
@@ -471,13 +471,7 @@ describe("Viewport of Simple sheet", () => {
471471 expect ( model . getters . getActiveMainViewport ( ) ) . toMatchObject ( {
472472 top : 0 ,
473473 bottom : 43 ,
474- left : 7 ,
475- right : 25 ,
476- } ) ;
477- expect ( model . getters . getActiveMainViewport ( ) ) . toMatchObject ( {
478- top : 0 ,
479- bottom : 43 ,
480- left : 7 ,
474+ left : 5 ,
481475 right : 25 ,
482476 } ) ;
483477 const { width : sheetViewWidth } = model . getters . getSheetViewDimension ( ) ;
@@ -518,7 +512,7 @@ describe("Viewport of Simple sheet", () => {
518512 } ) ;
519513 resizeRows ( model , [ ...Array ( numberRows ) . keys ( ) ] , DEFAULT_CELL_HEIGHT / 2 ) ;
520514 expect ( model . getters . getActiveMainViewport ( ) ) . toMatchObject ( {
521- top : 22 ,
515+ top : 20 ,
522516 bottom : 99 ,
523517 left : 0 ,
524518 right : 10 ,
@@ -553,11 +547,11 @@ describe("Viewport of Simple sheet", () => {
553547 expect ( model . getters . getActiveMainViewport ( ) ) . toMatchObject ( {
554548 top : viewport . top ,
555549 bottom : viewport . bottom ,
556- left : 3 ,
557- right : viewport . right ,
550+ left : 2 ,
551+ right : 12 , // stops at the last visible column
558552 } ) ;
559553 expect ( model . getters . getActiveSheetScrollInfo ( ) ) . toMatchObject ( {
560- scrollX : DEFAULT_CELL_WIDTH * 14 - model . getters . getSheetViewDimension ( ) . width ,
554+ scrollX : DEFAULT_CELL_WIDTH * 13 - model . getters . getSheetViewDimension ( ) . width ,
561555 scrollY : 0 ,
562556 } ) ;
563557 } ) ;
@@ -582,7 +576,7 @@ describe("Viewport of Simple sheet", () => {
582576 expect ( model . getters . getActiveMainViewport ( ) ) . toMatchObject ( viewport ) ;
583577 hideRows ( model , range ( 60 , 100 ) ) ;
584578 expect ( model . getters . getActiveMainViewport ( ) ) . toMatchObject ( {
585- top : 19 ,
579+ top : 18 ,
586580 bottom : 99 ,
587581 left : viewport . left ,
588582 right : viewport . right ,
@@ -1633,8 +1627,8 @@ describe("shift viewport up/down", () => {
16331627 selectCell ( model , selectedCell ) ;
16341628 model . dispatch ( "SHIFT_VIEWPORT_DOWN" ) ;
16351629 expect ( model . getters . getSelectedZone ( ) ) . toEqual ( {
1636- top : toZone ( selectedCell ) . top + 5 ,
1637- bottom : toZone ( selectedCell ) . bottom + 5 ,
1630+ top : toZone ( selectedCell ) . top + 4 ,
1631+ bottom : toZone ( selectedCell ) . bottom + 4 ,
16381632 left : 0 ,
16391633 right : 0 ,
16401634 } ) ;
0 commit comments