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

mobile slides bugs

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