Commit 9a846a2b authored by konovalovsergey's avatar konovalovsergey

math object not saved in html

parent f99ed7a0
......@@ -524,10 +524,14 @@ CopyProcessor.prototype =
}
else if(para_Math == item.Type){
var sSrc = item.MathToImageConverter();
if (null != sSrc && "" != sSrc && null != sSrc.ImageUrl){
if (null != sSrc && null != sSrc.ImageUrl){
var oImg = new CopyElement("img");
oImg.oAttributes["width"] = item.Width;
oImg.oAttributes["height"] = item.Height;
if (sSrc.w_px > 0) {
oImg.oAttributes["width"] = sSrc.w_px;
}
if (sSrc.h_px > 0) {
oImg.oAttributes["height"] = sSrc.h_px;
}
oImg.oAttributes["src"] = sSrc.ImageUrl;
oTarget.addChild(oImg);
}
......
......@@ -2636,7 +2636,7 @@ ParaMath.prototype.MathToImageConverter = function(bCopy, _canvasInput, _widthPx
if (undefined === _canvasInput)
{
var _ret = { ImageNative: _canvas, ImageUrl: "" };
var _ret = { ImageNative: _canvas, ImageUrl: "", w_px: _canvas.width, h_px: _canvas.height, w_mm: w_mm, h_mm: h_mm};
try
{
_ret.ImageUrl = _canvas.toDataURL("image/png");
......
......@@ -4139,11 +4139,11 @@ function BinaryDocumentTableWriter(memory, doc, oMapCommentId, oNumIdMap, copyPa
{
//заменяем на картинку, если бы был аналог CachedImage не надо было бы заменять
var sSrc = item.MathToImageConverter();
if (null != sSrc && "" != sSrc && null != sSrc.ImageUrl && item.Width > 0 && item.Height > 0){
if (null != sSrc && null != sSrc.ImageUrl && sSrc.w_mm > 0 && sSrc.h_mm > 0){
var doc = this.Document;
//todo paragraph
var drawing = new ParaDrawing(item.Width, item.Height, null, this.Document.DrawingDocument, this.Document, par);
var Image = editor.WordControl.m_oLogicDocument.DrawingObjects.createImage(sSrc.ImageUrl, 0, 0, item.Width, item.Height);
var drawing = new ParaDrawing(sSrc.w_mm, sSrc.h_mm, null, this.Document.DrawingDocument, this.Document, par);
var Image = editor.WordControl.m_oLogicDocument.DrawingObjects.createImage(sSrc.ImageUrl, 0, 0, sSrc.w_mm, sSrc.h_mm);
Image.cachedImage = sSrc.ImageUrl;
drawing.Set_GraphicObject(Image);
Image.setParent(drawing);
......
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