Commit 2ee4f2fe authored by Oleg Korshul's avatar Oleg Korshul

mobile bugs

parent f83afbce
......@@ -931,35 +931,8 @@
var _g = this.fillColor.g;
var _b = this.fillColor.b;
if (AscCommon.AscBrowser.isMobileVersion) {
// Special for iPad (5.1)
if (!_r && !_g && !_b) {
this.ctx.drawImage(pGlyph.oBitmap.oGlyphData.m_oCanvas, 0, 0, nW, nH, nX, nY, nW, nH);
} else {
var canvD = document.createElement('canvas');
canvD.width = nW;
canvD.height = nH;
var ctxD = canvD.getContext("2d");
var pixDst = ctxD.getImageData(0, 0, nW, nH);
var dstP = pixDst.data;
var data = pGlyph.oBitmap.oGlyphData.m_oContext.getImageData(0, 0, nW, nH);
var dataPx = data.data;
var cur = 0;
var cnt = 4 * nW * nH;
for (var i = 3; i < cnt; i += 4) {
dstP[cur++] = _r;
dstP[cur++] = _g;
dstP[cur++] = _b;
dstP[cur++] = dataPx[i];
}
ctxD.putImageData(pixDst, 0, 0, 0, 0, nW, nH);
this.ctx.drawImage(canvD, 0, 0, nW, nH, nX, nY, nW, nH);
}
} else {
pGlyph.oBitmap.oGlyphData.checkColor(_r, _g, _b, nW, nH);
pGlyph.oBitmap.draw(this.ctx, nX, nY);
}
pGlyph.oBitmap.oGlyphData.checkColor(_r, _g, _b, nW, nH);
pGlyph.oBitmap.draw(this.ctx, nX, nY);
};
DrawingContext.prototype.fillText = function (text, x, y, maxWidth, charWidths, angle) {
......
......@@ -86,7 +86,7 @@ var utils = (function () {
hasTransform: _transform !== false,
hasPerspective: _prefixStyle('perspective') in _elementStyle,
hasTouch: 'ontouchstart' in window,
hasPointer: (!('ontouchstart' in window)) && (!!(window.PointerEvent || window.MSPointerEvent)), // IE10 is prefixed
hasPointer: false,//(!('ontouchstart' in window)) && (!!(window.PointerEvent || window.MSPointerEvent)), // IE10 is prefixed
hasTransition: _prefixStyle('transition') in _elementStyle
});
......
......@@ -492,6 +492,33 @@
this.eventsElement = _id;
this.iScroll.eventsElement = this.eventsElement;
this.iScroll._initEvents();
// затачиваемся на конкретные div в интерфейсе ( потом переделать? )
var _arrayElements = [];
var _testElem = document.getElementById("editor-navbar");
if (_testElem)
_arrayElements.push(_testElem);
_testElem = document.getElementById("cell-editing-box");
if (_testElem)
_arrayElements.push(_testElem);
_testElem = document.getElementsByClassName("statusbar")[0];
if (_testElem)
_arrayElements.push(_testElem);
for (var i = _arrayElements.length - 1; i >= 0; i--)
{
_arrayElements[i].onmousedown = _arrayElements[i]["ontouchstart"] =
_arrayElements[i].onmousemove = _arrayElements[i]["ontouchmove"] =
_arrayElements[i].onmouseup = _arrayElements[i]["ontouchend"] =
_arrayElements[i]["ontouchcancel"] = function(e) { AscCommon.stopEvent(e); };
/*
_arrayElements["onpointerdown"] = _arrayElements["onmspointerdown"] =
_arrayElements["onpointermove"] = _arrayElements["onmspointermove"] =
_arrayElements["onpointerup"] = _arrayElements["onmspointerup"] =
_arrayElements[i]["onpointercancel"] = _arrayElements[i]["onmspointercancel"] = function(e) { AscCommon.stopEvent(e); };
*/
}
};
// создание вспомогательного элемента, для прокрутки. по идее потом можно изменить
......
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