Commit d47be5b3 authored by Sergey.Luzyanin's avatar Sergey.Luzyanin

отрисовка текстуры в настройках текстарта

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@64131 954022d7-b5bf-4e40-9824-e11837661b57
parent 2bef826d
......@@ -5834,10 +5834,10 @@ DrawingObjectsController.prototype =
{
oTextArtProperties.Fill = oTextPr.Unifill;
}
// else if(oTextPr.Color)
// {
// oTextArtProperties.Fill = CreateUnfilFromRGB(oTextPr.Color.r, oTextPr.Color.g, oTextPr.Color.b);
// }
else if(oTextPr.Color)
{
oTextArtProperties.Fill = CreateUnfilFromRGB(oTextPr.Color.r, oTextPr.Color.g, oTextPr.Color.b);
}
oTextArtProperties.Line = oTextPr.TextOutline;
if(oTextArtProperties.Fill)
{
......@@ -5903,6 +5903,7 @@ DrawingObjectsController.prototype =
shape_props.Width = props.shapeChartProps.w;
shape_props.Height = props.shapeChartProps.h;
var pr = shape_props.ShapeProperties;
var oTextArtProperties;
if (!isRealObject(props.shapeProps))
{
if (pr.fill != null && pr.fill.fill != null && pr.fill.fill.type == FILL_TYPE_BLIP)
......@@ -5918,6 +5919,24 @@ DrawingObjectsController.prototype =
this.drawingObjects.drawingDocument.InitGuiCanvasShape(api.shapeElementId);
this.drawingObjects.drawingDocument.DrawImageTextureFillShape(null);
}
if(pr.textArtProperties)
{
oTextArtProperties = pr.textArtProperties;
if(oTextArtProperties && oTextArtProperties.Fill && oTextArtProperties.Fill.fill && oTextArtProperties.Fill.fill.type == FILL_TYPE_BLIP)
{
if(api)
this.drawingObjects.drawingDocument.InitGuiCanvasTextArt(api.textArtElementId);
this.drawingObjects.drawingDocument.LastDrawingUrlTextArt = null;
this.WordControl.m_oDrawingDocument.DrawImageTextureFillTextArt(oTextArtProperties.Fill.fill.RasterImageId);
}
else
{
this.WordControl.m_oDrawingDocument.DrawImageTextureFillTextArt(null);
}
}
}
shape_props.ShapeProperties.fill = CreateAscFill(shape_props.ShapeProperties.fill);
shape_props.ShapeProperties.stroke = CreateAscStroke(shape_props.ShapeProperties.stroke, shape_props.ShapeProperties.canChangeArrows === true);
......@@ -5938,6 +5957,22 @@ DrawingObjectsController.prototype =
shape_props.ShapeProperties.bFromChart = props.shapeProps.bFromChart;
shape_props.ShapeProperties.textArtProperties = CreateAscTextArtProps(props.shapeProps.textArtProperties);
if(props.shapeProps.textArtProperties)
{
oTextArtProperties = props.shapeProps.textArtProperties;
if(oTextArtProperties && oTextArtProperties.Fill && oTextArtProperties.Fill.fill && oTextArtProperties.Fill.fill.type == FILL_TYPE_BLIP)
{
if(api)
this.drawingObjects.drawingDocument.InitGuiCanvasTextArt(api.textArtElementId);
this.drawingObjects.drawingDocument.LastDrawingUrlTextArt = null;
this.drawingObjects.drawingDocument.DrawImageTextureFillTextArt(oTextArtProperties.Fill.fill.RasterImageId);
}
else
{
this.drawingObjects.drawingDocument.DrawImageTextureFillTextArt(null);
}
}
if(props.shapeProps.paddings)
{
shape_props.ShapeProperties.paddings = new asc_CPaddings(props.shapeProps.paddings);
......
......@@ -133,6 +133,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
this.ImageLoader = window.g_image_loader;
this.ImageLoader.put_Api(this);
this.shapeElementId = null;
this.textArtElementId = null;
this.isImageChangeUrl = false;
this.isShapeImageChangeUrl = false;
......@@ -2782,6 +2783,10 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
this.shapeElementId = elementId;
};
spreadsheet_api.prototype.asc_setInterfaceDrawImagePlaceTextArt = function(elementId) {
this.textArtElementId = elementId;
};
spreadsheet_api.prototype.asc_changeImageFromFile = function() {
this.isImageChangeUrl = true;
this.asc_showImageFileDialog();
......@@ -3872,6 +3877,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
prot["asc_getOriginalImageSize"] = prot.asc_getOriginalImageSize;
prot["asc_changeShapeType"] = prot.asc_changeShapeType;
prot["asc_setInterfaceDrawImagePlaceShape"] = prot.asc_setInterfaceDrawImagePlaceShape;
prot["asc_setInterfaceDrawImagePlaceTextArt"] = prot.asc_setInterfaceDrawImagePlaceTextArt;
prot["asc_changeImageFromFile"] = prot.asc_changeImageFromFile;
prot["asc_putPrLineSpacing"] = prot.asc_putPrLineSpacing;
prot["asc_addTextArt"] = prot.asc_addTextArt;
......
......@@ -1797,6 +1797,13 @@ function CDrawingDocument(drawingObjects)
this.GuiCanvasFillTextureCtx = null;
this.LastDrawingUrl = "";
this.GuiCanvasFillTextureParentIdTextArt = "";
this.GuiCanvasFillTextureTextArt = null;
this.GuiCanvasFillTextureCtxTextArt = null;
this.LastDrawingUrlTextArt = "";
this.GuiCanvasTextProps = null;
this.GuiCanvasTextPropsId = "gui_textprops_canvas_id";
this.GuiLastTextProps = null;
......@@ -4368,6 +4375,79 @@ function CDrawingDocument(drawingObjects)
}
}
this.DrawImageTextureFillTextArt = function(url)
{
if (this.GuiCanvasFillTextureTextArt == null)
{
this.InitGuiCanvasTextArt(this.GuiCanvasFillTextureParentIdTextArt);
}
if (this.GuiCanvasFillTextureTextArt == null || this.GuiCanvasFillTextureCtxTextArt == null || url == this.LastDrawingUrlTextArt)
return;
this.LastDrawingUrlTextArt = url;
var _width = this.GuiCanvasFillTextureTextArt.width;
var _height = this.GuiCanvasFillTextureTextArt.height;
this.GuiCanvasFillTextureCtxTextArt.clearRect(0, 0, _width, _height);
if (null == this.LastDrawingUrlTextArt)
return;
var _img = this.m_oWordControl.m_oApi.ImageLoader.map_image_index[getFullImageSrc2(this.LastDrawingUrlTextArt)];
if (_img != undefined && _img.Image != null && _img.Status != ImageLoadStatus.Loading)
{
var _x = 0;
var _y = 0;
var _w = Math.max(_img.Image.width, 1);
var _h = Math.max(_img.Image.height, 1);
var dAspect1 = _width / _height;
var dAspect2 = _w / _h;
_w = _width;
_h = _height;
if (dAspect1 >= dAspect2)
{
_w = dAspect2 * _height;
_x = (_width - _w) / 2;
}
else
{
_h = _w / dAspect2;
_y = (_height - _h) / 2;
}
this.GuiCanvasFillTextureCtxTextArt.drawImage(_img.Image, _x, _y, _w, _h);
}
else
{
this.GuiCanvasFillTextureCtxTextArt.lineWidth = 1;
this.GuiCanvasFillTextureCtxTextArt.beginPath();
this.GuiCanvasFillTextureCtxTextArt.moveTo(0, 0);
this.GuiCanvasFillTextureCtxTextArt.lineTo(_width, _height);
this.GuiCanvasFillTextureCtxTextArt.moveTo(_width, 0);
this.GuiCanvasFillTextureCtxTextArt.lineTo(0, _height);
this.GuiCanvasFillTextureCtxTextArt.strokeStyle = "#FF0000";
this.GuiCanvasFillTextureCtxTextArt.stroke();
this.GuiCanvasFillTextureCtxTextArt.beginPath();
this.GuiCanvasFillTextureCtxTextArt.moveTo(0, 0);
this.GuiCanvasFillTextureCtxTextArt.lineTo(_width, 0);
this.GuiCanvasFillTextureCtxTextArt.lineTo(_width, _height);
this.GuiCanvasFillTextureCtxTextArt.lineTo(0, _height);
this.GuiCanvasFillTextureCtxTextArt.closePath();
this.GuiCanvasFillTextureCtxTextArt.strokeStyle = "#000000";
this.GuiCanvasFillTextureCtxTextArt.stroke();
this.GuiCanvasFillTextureCtxTextArt.beginPath();
}
}
this.InitGuiCanvasShape = function(div_id)
{
if (this.GuiCanvasFillTextureParentId == div_id && null != this.GuiCanvasFillTexture)
......@@ -4457,6 +4537,33 @@ function CDrawingDocument(drawingObjects)
}
}
this.InitGuiCanvasTextArt = function(div_id)
{
if (null != this.GuiCanvasFillTextureTextArt)
{
var _div_elem = document.getElementById(this.GuiCanvasFillTextureParentIdTextArt);
if (!_div_elem)
_div_elem.removeChild(this.GuiCanvasFillTextureTextArt);
this.GuiCanvasFillTextureTextArt = null;
this.GuiCanvasFillTextureCtxTextArt = null;
}
this.GuiCanvasFillTextureParentIdTextArt = div_id;
var _div_elem = document.getElementById(this.GuiCanvasFillTextureParentIdTextArt);
if (!_div_elem)
return;
this.GuiCanvasFillTextureTextArt = document.createElement('canvas');
this.GuiCanvasFillTextureTextArt.width = parseInt(_div_elem.style.width);
this.GuiCanvasFillTextureTextArt.height = parseInt(_div_elem.style.height);
this.LastDrawingUrlTextArt = "";
this.GuiCanvasFillTextureCtxTextArt = this.GuiCanvasFillTextureTextArt.getContext('2d');
_div_elem.appendChild(this.GuiCanvasFillTextureTextArt);
}
this.DrawGuiCanvasTextProps = function(props)
{
var bIsChange = false;
......
......@@ -1040,6 +1040,11 @@ function CDrawingDocument()
this.GuiCanvasFillTextureCtxSlide = null;
this.LastDrawingUrlSlide = "";
this.GuiCanvasFillTextureParentIdTextArt = "";
this.GuiCanvasFillTextureTextArt = null;
this.GuiCanvasFillTextureCtxTextArt = null;
this.LastDrawingUrlTextArt = "";
this.AutoShapesTrack = null;
this.TransitionSlide = new CTransitionAnimation(null);
......@@ -2980,6 +2985,78 @@ function CDrawingDocument()
}
}
this.DrawImageTextureFillTextArt = function(url)
{
if (this.GuiCanvasFillTextureTextArt == null)
{
this.InitGuiCanvasTextArt(this.GuiCanvasFillTextureParentIdTextArt);
}
if (this.GuiCanvasFillTextureTextArt == null || this.GuiCanvasFillTextureCtxTextArt == null || url == this.LastDrawingUrlTextArt)
return;
this.LastDrawingUrlTextArt = url;
var _width = this.GuiCanvasFillTextureTextArt.width;
var _height = this.GuiCanvasFillTextureTextArt.height;
this.GuiCanvasFillTextureCtxTextArt.clearRect(0, 0, _width, _height);
if (null == this.LastDrawingUrlTextArt)
return;
var _img = this.m_oWordControl.m_oApi.ImageLoader.map_image_index[getFullImageSrc2(this.LastDrawingUrlTextArt)];
if (_img != undefined && _img.Image != null && _img.Status != ImageLoadStatus.Loading)
{
var _x = 0;
var _y = 0;
var _w = Math.max(_img.Image.width, 1);
var _h = Math.max(_img.Image.height, 1);
var dAspect1 = _width / _height;
var dAspect2 = _w / _h;
_w = _width;
_h = _height;
if (dAspect1 >= dAspect2)
{
_w = dAspect2 * _height;
_x = (_width - _w) / 2;
}
else
{
_h = _w / dAspect2;
_y = (_height - _h) / 2;
}
this.GuiCanvasFillTextureCtxTextArt.drawImage(_img.Image, _x, _y, _w, _h);
}
else
{
this.GuiCanvasFillTextureCtxTextArt.lineWidth = 1;
this.GuiCanvasFillTextureCtxTextArt.beginPath();
this.GuiCanvasFillTextureCtxTextArt.moveTo(0, 0);
this.GuiCanvasFillTextureCtxTextArt.lineTo(_width, _height);
this.GuiCanvasFillTextureCtxTextArt.moveTo(_width, 0);
this.GuiCanvasFillTextureCtxTextArt.lineTo(0, _height);
this.GuiCanvasFillTextureCtxTextArt.strokeStyle = "#FF0000";
this.GuiCanvasFillTextureCtxTextArt.stroke();
this.GuiCanvasFillTextureCtxTextArt.beginPath();
this.GuiCanvasFillTextureCtxTextArt.moveTo(0, 0);
this.GuiCanvasFillTextureCtxTextArt.lineTo(_width, 0);
this.GuiCanvasFillTextureCtxTextArt.lineTo(_width, _height);
this.GuiCanvasFillTextureCtxTextArt.lineTo(0, _height);
this.GuiCanvasFillTextureCtxTextArt.closePath();
this.GuiCanvasFillTextureCtxTextArt.strokeStyle = "#000000";
this.GuiCanvasFillTextureCtxTextArt.stroke();
this.GuiCanvasFillTextureCtxTextArt.beginPath();
}
}
this.InitGuiCanvasShape = function(div_id)
{
if (null != this.GuiCanvasFillTexture)
......@@ -3034,6 +3111,33 @@ function CDrawingDocument()
_div_elem.appendChild(this.GuiCanvasFillTextureSlide);
}
this.InitGuiCanvasTextArt = function(div_id)
{
if (null != this.GuiCanvasFillTextureTextArt)
{
var _div_elem = document.getElementById(this.GuiCanvasFillTextureParentIdTextArt);
if (!_div_elem)
_div_elem.removeChild(this.GuiCanvasFillTextureTextArt);
this.GuiCanvasFillTextureTextArt = null;
this.GuiCanvasFillTextureCtxTextArt = null;
}
this.GuiCanvasFillTextureParentIdTextArt = div_id;
var _div_elem = document.getElementById(this.GuiCanvasFillTextureParentIdTextArt);
if (!_div_elem)
return;
this.GuiCanvasFillTextureTextArt = document.createElement('canvas');
this.GuiCanvasFillTextureTextArt.width = parseInt(_div_elem.style.width);
this.GuiCanvasFillTextureTextArt.height = parseInt(_div_elem.style.height);
this.LastDrawingUrlTextArt = "";
this.GuiCanvasFillTextureCtxTextArt = this.GuiCanvasFillTextureTextArt.getContext('2d');
_div_elem.appendChild(this.GuiCanvasFillTextureTextArt);
}
this.CheckTableStyles = function()
{
// сначала проверим, подписан ли кто на этот евент
......
......@@ -1027,6 +1027,12 @@ asc_docs_api.prototype.SetInterfaceDrawImagePlaceSlide = function(div_id)
{
this.WordControl.m_oDrawingDocument.InitGuiCanvasSlide(div_id);
};
asc_docs_api.prototype.SetInterfaceDrawImagePlaceTextArt = function(div_id)
{
this.WordControl.m_oDrawingDocument.InitGuiCanvasTextArt(div_id);
};
asc_docs_api.prototype.SetInterfaceDrawImagePlace = function()
{};
......@@ -2189,6 +2195,8 @@ asc_docs_api.prototype.ShapeApply = function(prop)
var image_url = "";
prop.Width = prop.w;
prop.Height = prop.h;
var bShapeTexture = true;
if (prop.fill != null)
{
if (prop.fill.fill != null && prop.fill.type == c_oAscFill.FILL_TYPE_BLIP)
......@@ -2202,6 +2210,22 @@ asc_docs_api.prototype.ShapeApply = function(prop)
}
}
}
var oFill;
if(prop.textArtProperties)
{
oFill = prop.textArtProperties.asc_getFill();
if (oFill.fill != null && oFill.type == c_oAscFill.FILL_TYPE_BLIP)
{
image_url = oFill.fill.asc_getUrl();
var _tx_id = oFill.fill.asc_getTextureId();
if (null != _tx_id && 0 <= _tx_id && _tx_id < g_oUserTexturePresets.length)
{
image_url = g_oUserTexturePresets[_tx_id];
}
bShapeTexture = false;
}
}
if (image_url != "")
{
var _image = this.ImageLoader.LoadImage(image_url, 1);
......@@ -2210,13 +2234,26 @@ asc_docs_api.prototype.ShapeApply = function(prop)
if(0 == image_url.indexOf(sFindString))
{
image_url = image_url.substring(sFindString.length);
}
if(bShapeTexture)
{
prop.fill.fill.asc_putUrl(image_url); // erase documentUrl
}
else
{
oFill.fill.asc_putUrl(image_url);
}
if (null != _image)
{
this.WordControl.m_oLogicDocument.ShapeApply(prop);
this.WordControl.m_oDrawingDocument.DrawImageTextureFillShape(image_url);
if(bShapeTexture)
{
this.WordControl.m_oDrawingDocument.DrawImageTextureFillShape(image_url);
}
else
{
this.WordControl.m_oDrawingDocument.DrawImageTextureFillTextArt(image_url);
}
}
else
{
......@@ -3029,6 +3066,11 @@ asc_docs_api.prototype.ChangeSlideImageFromFile = function()
this.isSlideImageChangeUrl = true;
this.AddImage();
};
asc_docs_api.prototype.ChangeArtImageFromFile = function()
{
this.isTextArtChangeUrl = true;
this.AddImage();
};
asc_docs_api.prototype.AddImage = function(){
var oImageUploader = document.getElementById("apiImageUpload");
......@@ -3126,111 +3168,81 @@ asc_docs_api.prototype.AddImageUrl = function(url){
}, _sendCommandCallback, rData);
}
};
asc_docs_api.prototype.AddImageUrlActionCallback = function(_image)
{
var _w = Page_Width - (X_Left_Margin + X_Right_Margin);
var _h = Page_Height - (Y_Top_Margin + Y_Bottom_Margin);
if (_image.Image != null)
{
var __w = Math.max((_image.Image.width * g_dKoef_pix_to_mm) >> 0, 1);
var __h = Math.max((_image.Image.height * g_dKoef_pix_to_mm) >> 0, 1);
_w = Math.max(5, Math.min(_w, __w));
_h = Math.max(5, Math.min((_w * __h / __w) >> 0));
}
var src = _image.src;
if (this.isShapeImageChangeUrl)
{
var AscShapeProp = new asc_CShapeProperty();
AscShapeProp.fill = new asc_CShapeFill();
AscShapeProp.fill.type = c_oAscFill.FILL_TYPE_BLIP;
AscShapeProp.fill.fill = new asc_CFillBlip();
AscShapeProp.fill.fill.asc_putUrl(src);
this.ShapeApply(AscShapeProp);
this.isShapeImageChangeUrl = false;
}
else if (this.isSlideImageChangeUrl)
{
var AscSlideProp = new CAscSlideProps();
AscSlideProp.Background = new asc_CShapeFill();
AscSlideProp.Background.type = c_oAscFill.FILL_TYPE_BLIP;
AscSlideProp.Background.fill = new asc_CFillBlip();
AscSlideProp.Background.fill.asc_putUrl(src);
this.SetSlideProps(AscSlideProp);
this.isSlideImageChangeUrl = false;
}
else if (this.isImageChangeUrl)
{
var AscImageProp = new asc_CImgProperty();
AscImageProp.ImageUrl = src;
this.ImgApply(AscImageProp);
this.isImageChangeUrl = false;
}
else if (this.isTextArtChangeUrl)
{
var AscShapeProp = new asc_CShapeProperty();
var oFill = new asc_CShapeFill();
oFill.type = c_oAscFill.FILL_TYPE_BLIP;
oFill.fill = new asc_CFillBlip();
oFill.fill.asc_putUrl(src);
AscShapeProp.textArtProperties = new asc_TextArtProperties();
AscShapeProp.textArtProperties.asc_putFill(oFill);
this.ShapeApply(AscShapeProp);
this.isTextArtChangeUrl = false;
}
else
{
var sFindString = editor.DocumentUrl + "media/";
if(0 == src.indexOf(sFindString))
src = src.substring(sFindString.length);
this.WordControl.m_oLogicDocument.Add_FlowImage(_w, _h, src);
}
}
asc_docs_api.prototype.AddImageUrlAction = function(url){
var _image = this.ImageLoader.LoadImage(url, 1);
if (null != _image)
{
var _w = Page_Width - (X_Left_Margin + X_Right_Margin);
var _h = Page_Height - (Y_Top_Margin + Y_Bottom_Margin);
if (_image.Image != null)
{
var __w = Math.max((_image.Image.width * g_dKoef_pix_to_mm) >> 0, 1);
var __h = Math.max((_image.Image.height * g_dKoef_pix_to_mm) >> 0, 1);
_w = Math.max(5, Math.min(_w, __w));
_h = Math.max(5, Math.min((_w * __h / __w) >> 0));
}
var src = _image.src;
if (this.isShapeImageChangeUrl)
{
var AscShapeProp = new asc_CShapeProperty();
AscShapeProp.fill = new asc_CShapeFill();
AscShapeProp.fill.type = c_oAscFill.FILL_TYPE_BLIP;
AscShapeProp.fill.fill = new asc_CFillBlip();
AscShapeProp.fill.fill.asc_putUrl(src);
this.ShapeApply(AscShapeProp);
this.isShapeImageChangeUrl = false;
}
else if (this.isSlideImageChangeUrl)
{
var AscSlideProp = new CAscSlideProps();
AscSlideProp.Background = new asc_CShapeFill();
AscSlideProp.Background.type = c_oAscFill.FILL_TYPE_BLIP;
AscSlideProp.Background.fill = new asc_CFillBlip();
AscSlideProp.Background.fill.asc_putUrl(src);
this.SetSlideProps(AscSlideProp);
this.isSlideImageChangeUrl = false;
}
else if (this.isImageChangeUrl)
{
var AscImageProp = new asc_CImgProperty();
AscImageProp.ImageUrl = src;
this.ImgApply(AscImageProp);
this.isImageChangeUrl = false;
}
else
{
var sFindString = editor.DocumentUrl + "media/";
if(0 == src.indexOf(sFindString))
src = src.substring(sFindString.length);
this.WordControl.m_oLogicDocument.Add_FlowImage(_w, _h, src);
}
this.AddImageUrlActionCallback(_image);
}
else
{
this.sync_StartAction(c_oAscAsyncActionType.Information, c_oAscAsyncAction.LoadImage);
this.asyncImageEndLoaded2 = function(_image)
{
var _w = Page_Width - (X_Left_Margin + X_Right_Margin);
var _h = Page_Height - (Y_Top_Margin + Y_Bottom_Margin);
if (_image.Image != null)
{
var __w = Math.max((_image.Image.width * g_dKoef_pix_to_mm) >> 0, 1);
var __h = Math.max((_image.Image.height * g_dKoef_pix_to_mm) >> 0, 1);
_w = Math.max(5, Math.min(_w, __w));
_h = Math.max(5, Math.min((_w * __h / __w) >> 0));
}
// this.WordControl.m_oLogicDocument.Create_NewHistoryPoint();
var src = _image.src;
//this.WordControl.m_oLogicDocument.Add_FlowImage(_w, _h, src);
if (this.isShapeImageChangeUrl)
{
var AscShapeProp = new asc_CShapeProperty();
AscShapeProp.fill = new asc_CShapeFill();
AscShapeProp.fill.type = c_oAscFill.FILL_TYPE_BLIP;
AscShapeProp.fill.fill = new asc_CFillBlip();
AscShapeProp.fill.fill.asc_putUrl(src);
this.ShapeApply(AscShapeProp);
this.isShapeImageChangeUrl = false;
}
else if (this.isSlideImageChangeUrl)
{
var AscSlideProp = new CAscSlideProps();
AscSlideProp.Background = new asc_CShapeFill();
AscSlideProp.Background.type = c_oAscFill.FILL_TYPE_BLIP;
AscSlideProp.Background.fill = new asc_CFillBlip();
AscSlideProp.Background.fill.asc_putUrl(src);
this.SetSlideProps(AscSlideProp);
this.isSlideImageChangeUrl = false;
}
else if (this.isImageChangeUrl)
{
var AscImageProp = new asc_CImgProperty();
AscImageProp.ImageUrl = src;
this.ImgApply(AscImageProp);
this.isImageChangeUrl = false;
}
else
{
var sFindString = editor.DocumentUrl + "media/";
if(0 == src.indexOf(sFindString))
src = src.substring(sFindString.length);
this.WordControl.m_oLogicDocument.Add_FlowImage(_w, _h, src);
}
this.AddImageUrlActionCallback(_image);
this.sync_EndAction(c_oAscAsyncActionType.Information, c_oAscAsyncAction.LoadImage);
this.asyncImageEndLoaded2 = null;
......@@ -4485,6 +4497,17 @@ asc_docs_api.prototype.sync_shapePropCallback = function(pr)
this.WordControl.m_oDrawingDocument.DrawImageTextureFillShape(null);
}
var oTextArtProperties = pr.textArtProperties;
if(oTextArtProperties && oTextArtProperties.Fill && oTextArtProperties.Fill.fill && oTextArtProperties.Fill.fill.type == FILL_TYPE_BLIP)
{
this.WordControl.m_oDrawingDocument.DrawImageTextureFillTextArt(oTextArtProperties.Fill.fill.RasterImageId);
}
else
{
this.WordControl.m_oDrawingDocument.DrawImageTextureFillTextArt(null);
}
var _len = this.SelectedObjectsStack.length;
if (_len > 0)
{
......
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