Commit 78fd3f89 authored by Alexey.Musinov's avatar Alexey.Musinov

ios fixed styles for charts

parent 356b0379
...@@ -5739,52 +5739,37 @@ Asc['asc_docs_api'].prototype.pre_Paste = function(_fonts, _images, callback) ...@@ -5739,52 +5739,37 @@ Asc['asc_docs_api'].prototype.pre_Paste = function(_fonts, _images, callback)
AscCommon.ChartPreviewManager.prototype.clearPreviews = function() AscCommon.ChartPreviewManager.prototype.clearPreviews = function()
{ {
window["native"]["DD_ClearCacheChartStyles"](); window["native"]["DD_ClearCacheChartStyles"]();
}; };
AscCommon.ChartPreviewManager.prototype.createChartPreview = function(_graphics, type, styleIndex) AscCommon.ChartPreviewManager.prototype.createChartPreview = function(_graphics, type, styleIndex)
{ {
return AscFormat.ExecuteNoHistory(function(){ return AscFormat.ExecuteNoHistory(function(){
if(!this.chartsByTypes[type]) if(!this.chartsByTypes[type])
this.chartsByTypes[type] = this.getChartByType(type); this.chartsByTypes[type] = this.getChartByType(type);
var chart_space = this.chartsByTypes[type];
if(chart_space.style !== styleIndex) var chart_space = this.chartsByTypes[type];
{ AscFormat.ApplyPresetToChartSpace(chart_space, AscCommon.g_oChartPresets[type][styleIndex]);
chart_space.style = styleIndex; chart_space.recalcInfo.recalculateReferences = false;
chart_space.recalculateMarkers(); chart_space.recalculate();
chart_space.recalculateSeriesColors();
chart_space.recalculatePlotAreaChartBrush(); // sizes for imageView
chart_space.recalculatePlotAreaChartPen(); window["native"]["DD_StartNativeDraw"](85 * 2, 85 * 2, 75, 75);
chart_space.recalculateChartBrush();
chart_space.recalculateChartPen();
chart_space.recalculateUpDownBars();
}
chart_space.recalculatePenBrush();
var _width_px = this.CHART_PREVIEW_WIDTH_PIX;
var _height_px = this.CHART_PREVIEW_WIDTH_PIX;
if (AscCommon.AscBrowser.isRetina)
{
_width_px <<= 1;
_height_px <<= 1;
}
window["native"]["DD_StartNativeDraw"](_width_px, _height_px, 50, 50);
var dKoefToMM = AscCommon.g_dKoef_pix_to_mm;
if (this.IsRetinaEnabled)
dKoefToMM /= 2;
chart_space.draw(_graphics);
_graphics.ClearParams();
var _stream = global_memory_stream_menu;
_stream["ClearNoAttack"]();
_stream["WriteByte"](4);
_stream["WriteLong"](type);
_stream["WriteLong"](styleIndex);
window["native"]["DD_EndNativeDraw"](_stream);
}, this, []);
var dKoefToMM = AscCommon.g_dKoef_pix_to_mm;
if (this.IsRetinaEnabled)
dKoefToMM /= 2;
chart_space.draw(_graphics);
_graphics.ClearParams();
var _stream = global_memory_stream_menu;
_stream["ClearNoAttack"]();
_stream["WriteByte"](4);
_stream["WriteLong"](type);
_stream["WriteLong"](styleIndex);
window["native"]["DD_EndNativeDraw"](_stream);
}, this, []);
}; };
AscCommon.ChartPreviewManager.prototype.getChartPreviews = function(chartType) AscCommon.ChartPreviewManager.prototype.getChartPreviews = function(chartType)
...@@ -5798,8 +5783,11 @@ AscCommon.ChartPreviewManager.prototype.getChartPreviews = function(chartType) ...@@ -5798,8 +5783,11 @@ AscCommon.ChartPreviewManager.prototype.getChartPreviews = function(chartType)
var _graphics = new CDrawingStream(); var _graphics = new CDrawingStream();
for (var i = 1; i < 49; ++i) if(AscCommon.g_oChartPresets[chartType]){
this.createChartPreview(_graphics, chartType, i); var nStylesCount = AscCommon.g_oChartPresets[chartType].length;
for(var i = 0; i < nStylesCount; ++i)
this.createChartPreview(_graphics, chartType, i);
}
var _stream = global_memory_stream_menu; var _stream = global_memory_stream_menu;
_stream["ClearNoAttack"](); _stream["ClearNoAttack"]();
......
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