Commit 5b55c153 authored by Oleg Korshul's avatar Oleg Korshul

mobile slides bugs

parent d979a8b4
......@@ -722,7 +722,7 @@ IScroll.prototype = {
this.enabled = true;
},
refresh: function () {
refresh: function (_position) {
var rf = this.wrapper.offsetHeight; // Force reflow
this.wrapperWidth = this.wrapper.clientWidth;
......@@ -759,6 +759,12 @@ IScroll.prototype = {
this._execEvent('refresh');
if (_position)
{
this.x = _position.X;
this.y = _position.Y;
}
this.resetPosition();
// INSERT POINT: _refresh
......
......@@ -150,6 +150,10 @@
{
return { W : 100, H : 100 };
};
CMobileDelegateSimple.prototype.GetScrollPosition = function()
{
return null;
};
CMobileDelegateSimple.prototype.ScrollTo = function(_scroll)
{
return;
......@@ -881,7 +885,8 @@
this.iScroll.scroller.style.width = _size.W + "px";
this.iScroll.scroller.style.height = _size.H + "px";
this.iScroll.refresh(true);
var _position = this.delegate.GetScrollPosition();
this.iScroll.refresh(_position);
}
};
......
......@@ -4861,6 +4861,9 @@ function CSlideDrawer()
this.BoundsChecker = new AscFormat.CSlideBoundsChecker();
this.CacheSlidePixW = 1;
this.CacheSlidePixH = 1;
this.bIsEmptyPresentation = false;
this.IsRecalculateSlide = false;
......@@ -4934,6 +4937,12 @@ function CSlideDrawer()
var _need_pix_width = this.BoundsChecker.Bounds.max_x - this.BoundsChecker.Bounds.min_x + 1 + 2 * this.SlideEps;
var _need_pix_height = this.BoundsChecker.Bounds.max_y - this.BoundsChecker.Bounds.min_y + 1 + 2 * this.SlideEps;
if (this.m_oWordControl.NoneRepaintPages)
return;
this.CacheSlidePixW = _need_pix_width;
this.CacheSlidePixH = _need_pix_height;
this.IsCached = false;
if (4 * _need_pix_width * _need_pix_height < this.CONST_MAX_SLIDE_CACHE_SIZE)
this.IsCached = true;
......@@ -5026,15 +5035,32 @@ function CSlideDrawer()
if (this.IsCached)
{
var w_px = (_bounds.max_x - _bounds.min_x + 1 + 2 * this.SlideEps) >> 0;
var h_px = (_bounds.max_y - _bounds.min_y + 1 + 2 * this.SlideEps) >> 0;
if (!this.m_oWordControl.NoneRepaintPages)
{
var w_px = (_bounds.max_x - _bounds.min_x + 1 + 2 * this.SlideEps) >> 0;
var h_px = (_bounds.max_y - _bounds.min_y + 1 + 2 * this.SlideEps) >> 0;
if (w_px > this.CachedCanvas.width)
w_px = this.CachedCanvas.width;
if (h_px > this.CachedCanvas.height)
h_px = this.CachedCanvas.height;
if (w_px > this.CachedCanvas.width)
w_px = this.CachedCanvas.width;
if (h_px > this.CachedCanvas.height)
h_px = this.CachedCanvas.height;
outputCtx.drawImage(this.CachedCanvas, 0, 0, w_px, h_px, (_x >> 0) - this.SlideEps, (_y >> 0) - this.SlideEps, w_px, h_px);
outputCtx.drawImage(this.CachedCanvas, 0, 0, w_px, h_px, (_x >> 0) - this.SlideEps, (_y >> 0) - this.SlideEps, w_px, h_px);
}
else
{
var w_px = (_bounds.max_x - _bounds.min_x + 1 + 2 * this.SlideEps) >> 0;
var h_px = (_bounds.max_y - _bounds.min_y + 1 + 2 * this.SlideEps) >> 0;
var w_px_src = this.CacheSlidePixW;
var h_px_src = this.CacheSlidePixH;
if (w_px_src > this.CachedCanvas.width)
w_px_src = this.CachedCanvas.width;
if (h_px_src > this.CachedCanvas.height)
h_px_src = this.CachedCanvas.height;
outputCtx.drawImage(this.CachedCanvas, 0, 0, w_px_src, h_px_src, (_x >> 0) - this.SlideEps, (_y >> 0) - this.SlideEps, w_px, h_px);
}
}
else
{
......
......@@ -334,6 +334,8 @@ function CEditorPage(api)
this.m_nIntervalWaitAutoSave = 1000;
this.m_nLastAutosaveTime = -1;
this.NoneRepaintPages = false;
this.m_oApi = api;
var oThis = this;
......@@ -2872,7 +2874,8 @@ function CEditorPage(api)
this.CheckZoom = function()
{
this.m_oDrawingDocument.ClearCachePages();
if (!this.NoneRepaintPages)
this.m_oDrawingDocument.ClearCachePages();
};
this.CalculateDocumentSize = function(bIsAttack)
......
......@@ -118,6 +118,13 @@
this.HtmlPage.m_oScrollVerApi.scrollToY(-_scroll.y + this.HtmlPage.SlideScrollMIN);
}
};
CMobileDelegateEditorPresentation.prototype.GetScrollPosition = function()
{
var _x = this.HtmlPage.m_dScrollX;
var _y = this.HtmlPage.m_dScrollY - this.HtmlPage.SlideScrollMIN;
return { X: -_x, Y: -_y };
};
CMobileDelegateEditorPresentation.prototype.GetContextMenuType = function()
{
var _mode = AscCommon.MobileTouchContextMenuType.Slide;
......@@ -709,8 +716,7 @@
{
// здесь нужно запускать отрисовку, если есть анимация зума
this.delegate.HtmlPage.NoneRepaintPages = false;
this.delegate.HtmlPage.m_bIsFullRepaint = true;
this.delegate.HtmlPage.OnScroll();
this.delegate.DrawingDocument.FirePaint();
this.Mode = AscCommon.MobileTouchMode.None;
isCheckContextMenuMode = false;
......
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