Commit c82ce7d2 authored by Alexey.Musinov's avatar Alexey.Musinov

[mobile] исправления для сборки скриптов

parent c5efc361
......@@ -678,10 +678,14 @@ WorksheetView.prototype.__changeSelectionTopLeft = function (x, y, isCoord, isSe
return this._calcActiveRangeOffset(x,y);
};
WorksheetView.prototype.__chartsRanges = function() {
WorksheetView.prototype.__chartsRanges = function(ranges) {
if (ranges) {
return this.__drawFormulaRanges(ranges, 0, 0, c_oAscSelectionType.RangeChart);
}
if (asc["editor"].isStartAddShape || this.objectRender.selectedGraphicObjectsExists()) {
if (this.isChartAreaEditMode) {
if (this.isChartAreaEditMode && this.arrActiveChartsRanges.length) {
return this.__drawFormulaRanges(this.arrActiveChartsRanges, 0, 0, c_oAscSelectionType.RangeChart);
}
}
......
......@@ -2867,6 +2867,41 @@ function OfflineEditor () {
// main
this.beforeOpen = function() {
function __selectDrawingObjectRange(drawing, worksheet) {
worksheet.cleanSelection();
worksheet.arrActiveChartsRanges = [];
if(!drawing.bbox || drawing.bbox.worksheet !== worksheet.model)
return;
// var stroke_color, fill_color;
// if (drawing.bbox.serBBox)
// {
// stroke_color = fill_color = new CColor(0, 128, 0);
// worksheet._drawElements(worksheet, worksheet._drawSelectionElement,
// asc.Range(drawing.bbox.serBBox.c1, drawing.bbox.serBBox.r1, drawing.bbox.serBBox.c2, drawing.bbox.serBBox.r2, true),
// false, 1,
// stroke_color, fill_color);
// }
// if(drawing.bbox.catBBox)
// {
// stroke_color = fill_color = new CColor(153, 0, 204);
// worksheet._drawElements(worksheet, worksheet._drawSelectionElement,
// asc.Range(drawing.bbox.catBBox.c1, drawing.bbox.catBBox.r1, drawing.bbox.catBBox.c2, drawing.bbox.catBBox.r2, true),
// false, 1,
// stroke_color, fill_color);
// }
var BB = drawing.bbox.seriesBBox;
var range = asc.Range(BB.c1, BB.r1, BB.c2, BB.r2, true);
worksheet.arrActiveChartsRanges.push(range);
worksheet.isChartAreaEditMode = true;
worksheet._drawSelection();
}
DrawingArea.prototype.drawSelection = function(drawingDocument) {
var canvas = this.worksheet.objectRender.getDrawingCanvas();
......@@ -2883,7 +2918,7 @@ function OfflineEditor () {
this.worksheet.overlayGraphicCtx.clear();
this.worksheet._drawCollaborativeElements();
if ( !this.worksheet.objectRender.controller.selectedObjects.length && !this.api.isStartAddShape )
if (!this.worksheet.objectRender.controller.selectedObjects.length && !this.api.isStartAddShape)
this.worksheet._drawSelection();
var chart;
......@@ -2892,7 +2927,8 @@ function OfflineEditor () {
if(selected_objects.length === 1 && selected_objects[0].getObjectType() === historyitem_type_ChartSpace)
{
chart = selected_objects[0];
this.worksheet.objectRender.selectDrawingObjectRange(chart);
__selectDrawingObjectRange(chart, this.worksheet); // <-
// this.worksheet.objectRender.selectDrawingObjectRange(chart);
//shapeOverlayCtx.ClearMode = true;
////selected_objects[0].draw(shapeOverlayCtx);
//shapeOverlayCtx.ClearMode = false;
......@@ -2906,12 +2942,12 @@ function OfflineEditor () {
if (null == drawingDocument.m_oDocumentRenderer) {
if (drawingDocument.m_bIsSelection) {
if (drawingDocument.m_bIsSelection) {
trackOverlay.m_oControl.HtmlElement.style.display = "block";
// if (drawingDocument.m_bIsSelection) {
// 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();
......@@ -2948,16 +2984,6 @@ function OfflineEditor () {
}
};
DrawingObjectsController.prototype.onMouseDown = function(e, x, y) {
var ret = this.curState.onMouseDown(e, x, y, 0);
if(e.ClickCount < 2)
{
//this.updateOverlay();
//this.updateSelectionState();
}
return ret;
};
Path.prototype.drawSmart = function(shape_drawer) {
var _graphics = shape_drawer.Graphics;
......@@ -4605,9 +4631,18 @@ function offline_mouse_down(x, y, pin, isViewerMode, isFormulaEditMode, isRangeR
ws.isChartAreaEditMode = false;
}
var ischart = false;
var controller = ws.objectRender.controller;
var selected_objects = controller.selection.groupSelection ? controller.selection.groupSelection.selectedObjects : controller.selectedObjects;
if (selected_objects.length === 1 && selected_objects[0].getObjectType() === historyitem_type_ChartSpace) {
ischart = true;
// console.log('CHART : ' + JSON.stringify(selected_objects[0].bbox.seriesBBox));
}
return {
id:graphicsInfo.id//,
//ischart: graphicsInfo.object.graphicObject instanceof CChartSpace
id:graphicsInfo.id,
ischart: ischart
};
}
......@@ -4772,6 +4807,9 @@ function offline_mouse_up(x, y, isViewerMode, isRangeResize, isChartRange, index
}
ws.applyMoveResizeRangeHandle(target);
var controller = ws.objectRender.controller;
controller.updateOverlay();
}
} else {
......@@ -4790,8 +4828,25 @@ function offline_get_selection(x, y, width, height, autocorrection) {
return _s.getSelection(x, y, width, height, autocorrection);
}
function offline_get_charts_ranges() {
var ws = _api.wb.getWorksheet();
var ranges = _api.wb.getWorksheet().__chartsRanges();
var cattbbox = null;
var serbbox = null;
var chart;
var controller = ws.objectRender.controller;
var selected_objects = controller.selection.groupSelection ? controller.selection.groupSelection.selectedObjects : controller.selectedObjects;
if (selected_objects.length === 1 && selected_objects[0].getObjectType() === historyitem_type_ChartSpace)
{
chart = selected_objects[0];
ranges = ranges ? ranges : _api.wb.getWorksheet().__chartsRanges([chart.bbox.seriesBBox]);
cattbbox = chart.bbox.catBBox ? _api.wb.getWorksheet().__chartsRanges([chart.bbox.catBBox]) : null;
serbbox = chart.bbox.serBBox ? _api.wb.getWorksheet().__chartsRanges([chart.bbox.serBBox]) : null;
}
return {'ranges': _api.wb.getWorksheet().__chartsRanges()};
return {'ranges':ranges, 'cattbbox':cattbbox, 'serbbox':serbbox};
}
function offline_get_worksheet_bounds() {
return _s.getMaxBounds();
......
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