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)
AscCommon.ChartPreviewManager.prototype.clearPreviews = function()
{
window["native"]["DD_ClearCacheChartStyles"]();
};
};
AscCommon.ChartPreviewManager.prototype.createChartPreview = function(_graphics, type, styleIndex)
{
return AscFormat.ExecuteNoHistory(function(){
if(!this.chartsByTypes[type])
this.chartsByTypes[type] = this.getChartByType(type);
var chart_space = this.chartsByTypes[type];
if(chart_space.style !== styleIndex)
{
chart_space.style = styleIndex;
chart_space.recalculateMarkers();
chart_space.recalculateSeriesColors();
chart_space.recalculatePlotAreaChartBrush();
chart_space.recalculatePlotAreaChartPen();
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, []);
if(!this.chartsByTypes[type])
this.chartsByTypes[type] = this.getChartByType(type);
var chart_space = this.chartsByTypes[type];
AscFormat.ApplyPresetToChartSpace(chart_space, AscCommon.g_oChartPresets[type][styleIndex]);
chart_space.recalcInfo.recalculateReferences = false;
chart_space.recalculate();
// sizes for imageView
window["native"]["DD_StartNativeDraw"](85 * 2, 85 * 2, 75, 75);
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)
......@@ -5798,8 +5783,11 @@ AscCommon.ChartPreviewManager.prototype.getChartPreviews = function(chartType)
var _graphics = new CDrawingStream();
for (var i = 1; i < 49; ++i)
this.createChartPreview(_graphics, chartType, i);
if(AscCommon.g_oChartPresets[chartType]){
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;
_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