Commit 9d75a1bb authored by Dmitry.Vikulov's avatar Dmitry.Vikulov Committed by Alexander.Trofimov

Фикс: при скролах графики были пропуски снизу и справа

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@53241 954022d7-b5bf-4e40-9824-e11837661b57
parent e4e10827
...@@ -2454,6 +2454,16 @@ function GraphicOption(ws, type, delta) { ...@@ -2454,6 +2454,16 @@ function GraphicOption(ws, type, delta) {
_this.type = type; _this.type = type;
_this.delta = delta; // Scroll offset: + Down || - Up _this.delta = delta; // Scroll offset: + Down || - Up
function checkCol(col) {
while ( (col > 0) && !_this.ws.cols[col] )
_this.ws.expandColsOnScroll(true);
}
function checkRow(row) {
while ( (row > 0) && !_this.ws.rows[row] )
_this.ws.expandRowsOnScroll(true);
}
_this.isScrollType = function() { _this.isScrollType = function() {
return ( (_this.type === c_oAscGraphicOption.ScrollVertical) || (_this.type === c_oAscGraphicOption.ScrollHorizontal) ); return ( (_this.type === c_oAscGraphicOption.ScrollVertical) || (_this.type === c_oAscGraphicOption.ScrollHorizontal) );
} }
...@@ -2467,21 +2477,29 @@ function GraphicOption(ws, type, delta) { ...@@ -2467,21 +2477,29 @@ function GraphicOption(ws, type, delta) {
switch (_this.type) { switch (_this.type) {
case c_oAscGraphicOption.ScrollVertical: { case c_oAscGraphicOption.ScrollVertical: {
// Down // Down
if ( _this.delta > 0 ) if ( _this.delta > 0 ) {
vr.r1 = vr.r2 - _this.delta; vr.r1 = vr.r2 - _this.delta;
checkRow(++vr.r2);
}
// Up // Up
else else
vr.r2 = vr.r1 - _this.delta; vr.r2 = vr.r1 - _this.delta;
checkCol(++vr.c2);
} }
break; break;
case c_oAscGraphicOption.ScrollHorizontal: { case c_oAscGraphicOption.ScrollHorizontal: {
// Right // Right
if ( _this.delta > 0 ) if ( _this.delta > 0 ) {
vr.c1 = vr.c2 - _this.delta; vr.c1 = vr.c2 - _this.delta;
checkCol(++vr.c2);
}
// Left // Left
else else
vr.c2 = vr.c1 - _this.delta; vr.c2 = vr.c1 - _this.delta;
checkRow(++vr.r2);
} }
break; break;
...@@ -2497,12 +2515,10 @@ function GraphicOption(ws, type, delta) { ...@@ -2497,12 +2515,10 @@ function GraphicOption(ws, type, delta) {
vr.c1 = Math.max(coords.from.col, vr.c1); vr.c1 = Math.max(coords.from.col, vr.c1);
vr.r1 = Math.max(coords.from.row, vr.r1); vr.r1 = Math.max(coords.from.row, vr.r1);
if ( !_this.ws.cols[coords.to.col + 1] ) checkCol(coords.to.col + 1);
_this.ws.expandColsOnScroll(true);
vr.c2 = Math.min(coords.to.col + 1, vr.c2); vr.c2 = Math.min(coords.to.col + 1, vr.c2);
if ( !_this.ws.rows[coords.to.row + 1] ) checkRow(coords.to.row + 1);
_this.ws.expandRowsOnScroll(true);
vr.r2 = Math.min(coords.to.row + 1, vr.r2); vr.r2 = Math.min(coords.to.row + 1, vr.r2);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment