Commit 63ddff6f authored by Oleg Korshul's avatar Oleg Korshul Committed by Alexander.Trofimov

Баги с файлом унесенные ветром

parent a84688b1
...@@ -224,7 +224,8 @@ function CEditorPage(api) ...@@ -224,7 +224,8 @@ function CEditorPage(api)
this.m_oApi = api; this.m_oApi = api;
var oThis = this; var oThis = this;
this.UseRequestAnimationFrame = false; //this.UseRequestAnimationFrame = false;
this.UseRequestAnimationFrame = (undefined !== window["AscDesktopEditor"]) ? true : false;
this.RequestAnimationFrame = (function() { this.RequestAnimationFrame = (function() {
return window.requestAnimationFrame || return window.requestAnimationFrame ||
window.webkitRequestAnimationFrame || window.webkitRequestAnimationFrame ||
...@@ -2683,7 +2684,10 @@ function CEditorPage(api) ...@@ -2683,7 +2684,10 @@ function CEditorPage(api)
if (newScrollPos <= 0 || newScrollPos >= this.m_dScrollY_max) if (newScrollPos <= 0 || newScrollPos >= this.m_dScrollY_max)
return res; return res;
var del = parseInt(20 + g_dKoef_mm_to_pix * Page_Height * this.m_nZoomValue / 100); var _heightPageMM = Page_Height;
if (this.m_oDrawingDocument.m_arrPages.length > 0)
_heightPageMM = this.m_oDrawingDocument.m_arrPages[0].height_mm;
var del = 20 + (g_dKoef_mm_to_pix * _heightPageMM * this.m_nZoomValue / 100 + 0.5) >> 0;
var delta = Math.abs(newScrollPos - this.m_dScrollY); var delta = Math.abs(newScrollPos - this.m_dScrollY);
if (this.m_oDrawingDocument.m_lPagesCount <= 10) if (this.m_oDrawingDocument.m_lPagesCount <= 10)
...@@ -3572,8 +3576,8 @@ function CEditorPage(api) ...@@ -3572,8 +3576,8 @@ function CEditorPage(api)
if (mm_h > this.m_dDocumentPageHeight) if (mm_h > this.m_dDocumentPageHeight)
this.m_dDocumentPageHeight = mm_h; this.m_dDocumentPageHeight = mm_h;
var _pageWidth = parseInt(mm_w * dKoef); var _pageWidth = (mm_w * dKoef) >> 0;
var _pageHeight = parseInt(mm_h * dKoef); var _pageHeight = (mm_h * dKoef + 0.5) >> 0;
if (_pageWidth > this.m_dDocumentWidth) if (_pageWidth > this.m_dDocumentWidth)
this.m_dDocumentWidth = _pageWidth; this.m_dDocumentWidth = _pageWidth;
...@@ -3681,7 +3685,7 @@ function CEditorPage(api) ...@@ -3681,7 +3685,7 @@ function CEditorPage(api)
if (-1 == oThis.RequestAnimationOldTime || (now >= (oThis.RequestAnimationOldTime + 40))) if (-1 == oThis.RequestAnimationOldTime || (now >= (oThis.RequestAnimationOldTime + 40)))
{ {
oThis.RequestAnimationOldTime = now; oThis.RequestAnimationOldTime = now;
oThis.onTimerScroll2_sync(); oThis.onTimerScroll2(true);
} }
oThis.RequestAnimationFrame.call(window, oThis.AnimationFrame); oThis.RequestAnimationFrame.call(window, oThis.AnimationFrame);
} }
...@@ -3719,7 +3723,7 @@ function CEditorPage(api) ...@@ -3719,7 +3723,7 @@ function CEditorPage(api)
this.onTimerScroll2(); this.onTimerScroll2();
} }
this.onTimerScroll2_internal = function() this.onTimerScroll2_internal = function(is_no_timer)
{ {
var oWordControl = oThis; var oWordControl = oThis;
...@@ -3787,14 +3791,15 @@ function CEditorPage(api) ...@@ -3787,14 +3791,15 @@ function CEditorPage(api)
oWordControl.m_oApi.asc_fireCallback("asc_onPaintTimer"); oWordControl.m_oApi.asc_fireCallback("asc_onPaintTimer");
if (true !== is_no_timer)
this.m_nPaintTimerId = setTimeout(oWordControl.onTimerScroll2, oWordControl.m_nTimerScrollInterval); this.m_nPaintTimerId = setTimeout(oWordControl.onTimerScroll2, oWordControl.m_nTimerScrollInterval);
//window.requestAnimationFrame(oWordControl.onTimerScroll2); //window.requestAnimationFrame(oWordControl.onTimerScroll2);
} }
this.onTimerScroll2 = function() this.onTimerScroll2 = function(is_no_timer)
{ {
try try
{ {
oThis.onTimerScroll2_internal(); oThis.onTimerScroll2_internal(is_no_timer);
} }
catch (err) catch (err)
{ {
...@@ -3977,7 +3982,7 @@ function CEditorPage(api) ...@@ -3977,7 +3982,7 @@ function CEditorPage(api)
var lYPos = 0; var lYPos = 0;
for (var i = 0; i < page; i++) for (var i = 0; i < page; i++)
{ {
lYPos += (20 + parseInt(this.m_oDrawingDocument.m_arrPages[i].height_mm * dKoef)); lYPos += (20 + (this.m_oDrawingDocument.m_arrPages[i].height_mm * dKoef + 0.5) >> 0);
} }
lYPos += y * dKoef; lYPos += y * dKoef;
......
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