Browse Source

处理翻转问题

CrazyIter_Bin 4 years ago
parent
commit
937b203f22

+ 3 - 3
HTEXLib/HTEXLib.csproj

@@ -4,9 +4,9 @@
     <Description>修复图片节点WMF</Description>
     <PackageReleaseNotes>模板解析类型</PackageReleaseNotes>
     <GeneratePackageOnBuild>true</GeneratePackageOnBuild>
-    <Version>2.3.5</Version>
-    <AssemblyVersion>2.3.5.5</AssemblyVersion>
-    <FileVersion>2.3.5.5</FileVersion>
+    <Version>2.3.6</Version>
+    <AssemblyVersion>2.3.6.6</AssemblyVersion>
+    <FileVersion>2.3.6.6</FileVersion>
   </PropertyGroup>
   <ItemGroup>
     <PackageReference Include="DocumentFormat.OpenXml" Version="2.11.3" />

+ 1 - 1
HTEXLib/PPTX/Models/HTEX/HtexConnectionShape.cs

@@ -69,7 +69,7 @@ namespace HTEXLib.Models.HTEX
             }
            
             Svg svg = SvgHelper.GenShapeSvg(shapeTypeNode, shapeType, position,   shapeBorder);
-            Connector item = new Connector { sid =sid, type =type,cxnType=shapeType,index = index,  svg = svg ,uid= connectionShape .suid};
+            Connector item = new Connector { sid =sid, type =type,cxnType=shapeType,index = index,  svg = svg ,uid= connectionShape .suid,subName= connectionShape .NonVisualShapeProp.SubName};
             item.style.position = position;
             item.style.border = shapeBorder;
             item.links = slide.hyperlinks;

+ 5 - 2
HTEXLib/PPTX/Models/HTEX/HtexShape.cs

@@ -49,7 +49,7 @@ namespace HTEXLib.Models.HTEX
             Position position = new Position { cx= width, cy= height, x=left,y=top,rot=rot};
             var ShapeStyle =PPTXHelper.DoShapeProperties(Shape.element.ShapeProperties, slide,type,partForm);
             //position = position ,mediaType = "image",type = type,index = index,animatable = animatable ,invisible = invisible
-            Shape shape = new Shape() { sid = sid,  textBody = DrawText() ,type=type,index=index/*,animatable=animatable,invisible=invisible*/ };
+            Shape shape = new Shape() { sid = sid,  textBody = DrawText() ,type=type,index=index/*,animatable=animatable,invisible=invisible*/ ,  subName = Shape.NonVisualShapeProp.SubName };
             shape.style.position = position;
             shape.haspar = shape.textBody != null ? shape.textBody.paragraphs != null && shape.textBody.paragraphs.Count > 0 ? true : false : false;
             var shapeTypeNode = Shape.element.ShapeProperties.GetFirstChild<PresetGeometry>();
@@ -102,6 +102,8 @@ namespace HTEXLib.Models.HTEX
             //    });
             //}
             var shapeType = "rect";
+
+            
             if (shapeTypeNode != null && shapeTypeNode.Preset != null && !string.IsNullOrEmpty(shapeTypeNode.Preset.InnerText))
             {
                 shapeType = shapeTypeNode.Preset.InnerText;
@@ -114,7 +116,8 @@ namespace HTEXLib.Models.HTEX
                 shape.svg = svg;
                 shape.shapeType = shapeType;
             }
-
+            position.flipV = Shape.element.ShapeProperties.Transform2D!=null? Shape.element.ShapeProperties.Transform2D.VerticalFlip != null && Shape.element.ShapeProperties.Transform2D.VerticalFlip.Value ? 1 : 0:0;
+            position.flipH = Shape.element.ShapeProperties.Transform2D != null ? Shape.element.ShapeProperties.Transform2D.HorizontalFlip != null && Shape.element.ShapeProperties.Transform2D.HorizontalFlip.Value ? 1 : 0:0;
             shape = PPTXHelper.DoCustomGeometry(shapeTypeCustom, shape);
             var elmt = new List<Item> ();
             shape.uid = Shape.suid;

+ 2 - 0
HTEXLib/PPTX/Models/Item.cs

@@ -7,6 +7,8 @@ namespace HTEXLib
 {
     public abstract class Item
     {
+
+        public string desc { get; set; }
         /// <summary>
         /// http://sc.chinaz.com/jiaobendemo.aspx?downloadid=42016103430419  动画插件
         /// </summary>

+ 1 - 0
HTEXLib/PPTX/Models/PPTX/PPTShapeBase.cs

@@ -12,6 +12,7 @@ namespace HTEXLib.Models.Inner
 {
     public class PPTShapeBase
     {
+        public string desc { get; set; }
         public List<string> note { get; set; }
         public List<HTEXLib.PPTX.Models.HyperLink> hyperlinks { get; set; } = new List<HTEXLib.PPTX.Models.HyperLink>();
         public OpenXmlPart openXmlPart { get; set; }