Commit 0f76dd3f authored by Oleg Korshul's avatar Oleg Korshul

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

parent 4bf07dd9
...@@ -248,7 +248,8 @@ function CEditorPage(api) ...@@ -248,7 +248,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 ||
...@@ -2707,7 +2708,10 @@ function CEditorPage(api) ...@@ -2707,7 +2708,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)
...@@ -3596,8 +3600,8 @@ function CEditorPage(api) ...@@ -3596,8 +3600,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;
...@@ -3705,7 +3709,7 @@ function CEditorPage(api) ...@@ -3705,7 +3709,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);
} }
...@@ -3743,7 +3747,7 @@ function CEditorPage(api) ...@@ -3743,7 +3747,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;
...@@ -3811,14 +3815,15 @@ function CEditorPage(api) ...@@ -3811,14 +3815,15 @@ function CEditorPage(api)
oWordControl.m_oApi.asc_fireCallback("asc_onPaintTimer"); oWordControl.m_oApi.asc_fireCallback("asc_onPaintTimer");
this.m_nPaintTimerId = setTimeout(oWordControl.onTimerScroll2, oWordControl.m_nTimerScrollInterval); if (true !== is_no_timer)
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)
{ {
...@@ -4001,7 +4006,7 @@ function CEditorPage(api) ...@@ -4001,7 +4006,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