Commit f06b9b1e authored by Oleg Korshul's avatar Oleg Korshul

.

parent f7a6873f
......@@ -1456,7 +1456,7 @@ function CDrawingDocument(drawingObjects)
this.GuiCanvasFillTextureCtxTextArt = null;
this.LastDrawingUrlTextArt = "";
this.SelectionMatrix = null;
this.GuiCanvasTextProps = null;
this.GuiCanvasTextPropsId = "gui_textprops_canvas_id";
......@@ -3133,6 +3133,8 @@ function CDrawingDocument(drawingObjects)
this.AddPageSelection = function(pageIndex, x, y, w, h)
{
if (null == this.SelectionMatrix)
this.SelectionMatrix = this.TextMatrix;
/* if (pageIndex < this.m_lDrawingFirst || pageIndex > this.m_lDrawingEnd)
{
return;
......
......@@ -263,7 +263,7 @@
<canvas id="ws-canvas-graphic"></canvas>\
<canvas id="ws-canvas-graphic-overlay"></canvas>\
<canvas id="id_target_cursor" class="block_elem" width="1" height="1"\
style="width:2px;height:13px;display:none;z-index:1004;"></canvas>\
style="width:2px;height:13px;display:none;z-index:9;"></canvas>\
</div>';
this.canvas = document.getElementById("ws-canvas");
......@@ -3018,6 +3018,9 @@
return !this.getWorksheet().getSelectionShape();
};
WorkbookView.prototype.GetSelectionRectsBounds = function () {
if (this.getWorksheet().getSelectionShape())
return null;
var ws = this.getWorksheet();
var range = ws.getSelectedRange().bbox;
var l = ws.getCellLeft(range.c1, 3);
......
......@@ -101,6 +101,12 @@ function (window, undefined)
H : this.WB.element.clientHeight + this.WB.m_dScrollY_max
};
};
CMobileDelegateEditorCell.prototype.GetSelectionTransform = function()
{
if (this.WB.getWorksheet().objectRender.controller.selectedObjects.length == 0)
return null;
return this.WB.getWorksheet().objectRender.controller.drawingDocument.SelectionMatrix;
};
CMobileDelegateEditorCell.prototype.GetScrollerParent = function()
{
return this.WB.element;
......@@ -338,10 +344,11 @@ function (window, undefined)
CMobileTouchManager.prototype.onTouchStart = function(e)
{
var _e = e.touches ? e.touches[0] : e;
this.IsTouching = true;
global_mouseEvent.KoefPixToMM = 5;
AscCommon.check_MouseDownEvent(e.touches ? e.touches[0] : e, true);
AscCommon.check_MouseDownEvent(_e, true);
global_mouseEvent.KoefPixToMM = 1;
global_mouseEvent.LockMouse();
this.Api.sendEvent("asc_onHidePopMenu");
......@@ -433,8 +440,7 @@ function (window, undefined)
this.delegate.Logic_OnMouseDown(global_mouseEvent, __X, __Y, this.PageSelect2);
}
var pos1 = this.delegate.ConvertCoordsFromCursor(global_mouseEvent.X + this.delegate.Offset.X, global_mouseEvent.Y + this.delegate.Offset.Y);
this.delegate.Logic_OnMouseMove(global_mouseEvent, pos1.X, pos1.Y, pos1.Page);
this.delegate.Drawing_OnMouseMove(_e);
}
else if (2 == this.DragSelect)
{
......@@ -452,8 +458,7 @@ function (window, undefined)
this.delegate.Logic_OnMouseDown(global_mouseEvent, __X, __Y, this.PageSelect1);
}
var pos4 = this.delegate.ConvertCoordsFromCursor(global_mouseEvent.X + this.delegate.Offset.X, global_mouseEvent.Y + this.delegate.Offset.Y);
this.delegate.Logic_OnMouseMove(global_mouseEvent, pos4.X, pos4.Y, pos4.Page);
this.delegate.Drawing_OnMouseMove(_e);
}
break;
}
......@@ -503,6 +508,7 @@ function (window, undefined)
};
CMobileTouchManager.prototype.onTouchMove = function(e)
{
var _e = e.touches ? e.touches[0] : e;
if (this.Mode != AscCommon.MobileTouchMode.FlowObj && this.Mode != AscCommon.MobileTouchMode.TableMove)
AscCommon.check_MouseMoveEvent(e.touches ? e.touches[0] : e);
......@@ -583,8 +589,7 @@ function (window, undefined)
{
// во время движения может смениться порядок ректов
global_mouseEvent.ClickCount = 1;
var pos = this.delegate.ConvertCoordsFromCursor(global_mouseEvent.X + this.delegate.Offset.X, global_mouseEvent.Y + this.delegate.Offset.Y);
this.delegate.Logic_OnMouseMove(global_mouseEvent, pos.X, pos.Y, pos.Page);
this.delegate.Drawing_OnMouseMove(_e);
AscCommon.stopEvent(e);
break;
}
......@@ -655,8 +660,7 @@ function (window, undefined)
// ничего не нужно делать
this.DragSelect = 0;
this.Mode = AscCommon.MobileTouchMode.None;
var pos = this.delegate.ConvertCoordsFromCursor(global_mouseEvent.X + this.delegate.Offset.X, global_mouseEvent.Y + this.delegate.Offset.Y);
this.delegate.Logic_OnMouseUp(global_mouseEvent, pos.X, pos.Y, pos.Page);
this.delegate.Drawing_OnMouseUp(_e);
AscCommon.stopEvent(e);
break;
}
......@@ -693,7 +697,7 @@ function (window, undefined)
};
// отрисовка текстового селекта
CMobileTouchManager.prototype.CheckSelect = function(overlay, color)
CMobileTouchManager.prototype.CheckSelect = function(overlay, color, drDocument)
{
if (!this.SelectEnabled)
return;
......
......@@ -711,17 +711,19 @@ DrawingArea.prototype.drawSelection = function(drawingDocument) {
// Clip
this.frozenPlaces[i].clip(shapeOverlayCtx);
if (null == drawingDocument.m_oDocumentRenderer) {
if (true) {
if (drawingDocument.m_bIsSelection) {
if (drawingDocument.m_bIsSelection) {
trackOverlay.m_oControl.HtmlElement.style.display = "block";
drawingDocument.SelectionMatrix = null;
trackOverlay.m_oControl.HtmlElement.style.display = "block";
if (null == trackOverlay.m_oContext)
trackOverlay.m_oContext = trackOverlay.m_oControl.HtmlElement.getContext('2d');
if (null == trackOverlay.m_oContext)
trackOverlay.m_oContext = trackOverlay.m_oControl.HtmlElement.getContext('2d');
}
drawingDocument.private_StartDrawSelection(trackOverlay);
this.worksheet.objectRender.controller.drawTextSelection();
drawingDocument.private_EndDrawSelection();
this.worksheet.handlers.trigger("drawMobileSelection");
}
ctx.globalAlpha = 1.0;
......@@ -734,20 +736,6 @@ DrawingArea.prototype.drawSelection = function(drawingDocument) {
shapeOverlayCtx.put_GlobalAlpha(true, 1);
}
}
else {
ctx.fillStyle = "rgba(51,102,204,255)";
ctx.beginPath();
for (var j = drawingDocument.m_lDrawingFirst; j <= drawingDocument.m_lDrawingEnd; j++) {
var drawPage = drawingDocument.m_arrPages[j].drawingPage;
drawingDocument.m_oDocumentRenderer.DrawSelection(j, trackOverlay, drawPage.left, drawPage.top, drawPage.right - drawPage.left, drawPage.bottom - drawPage.top);
}
ctx.globalAlpha = 0.2;
ctx.fill();
ctx.beginPath();
ctx.globalAlpha = 1.0;
}
// Restore
this.frozenPlaces[i].restore(shapeOverlayCtx);
......
......@@ -58,6 +58,7 @@ var c_oAscValAxisRule = Asc.c_oAscValAxisRule;
var c_oAscInsertOptions = Asc.c_oAscInsertOptions;
var c_oAscDeleteOptions = Asc.c_oAscDeleteOptions;
var c_oAscSelectionType = Asc.c_oAscSelectionType;
var global_mouseEvent = AscCommon.global_mouseEvent;
var aSparklinesStyles =
[
......@@ -4504,6 +4505,10 @@ function ObjectLocker(ws) {
function ClickCounter() {
this.x = 0;
this.y = 0;
this.lastX = -1000;
this.lastY = -1000;
this.button = 0;
this.time = 0;
this.clickCount = 0;
......@@ -4511,12 +4516,27 @@ function ClickCounter() {
}
ClickCounter.prototype.mouseDownEvent = function(x, y, button) {
var currTime = getCurrentTime();
if (this.button === button && this.x === x && this.y === y && (currTime - this.time < 500)) {
var _eps = 3 * global_mouseEvent.KoefPixToMM;
if ((Math.abs(global_mouseEvent.X - global_mouseEvent.LastX) > _eps) || (Math.abs(global_mouseEvent.Y - global_mouseEvent.LastY) > _eps))
{
// not only move!!! (touch - fast click in different places)
global_mouseEvent.LastClickTime = -1;
global_mouseEvent.ClickCount = 0;
}
this.x = x;
this.y = y;
if (this.button === button && Math.abs(this.x - this.lastX) <= _eps && Math.abs(this.y - this.lastY) <= _eps && (currTime - this.time < 500)) {
++this.clickCount;
} else {
this.clickCount = 1;
}
this.lastX = this.x;
this.lastY = this.y;
if (this.log) {
console.log("-----");
console.log("x-> " + this.x + " : " + x);
......
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