123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- using HTEXLib.Helpers.ShapeHelpers;
- using System;
- using System.Collections.Generic;
- using System.Text;
- namespace HTEXLib.Models.HTEX
- {
- public class HtexGroupShape : HtexElement
- {
- public HtexGroupShape(string id, double rot, double width, double height,
- double top, double left, bool invisible,
- bool animatable, int index, Inner.PPTGroupShape groupShape, PPTSlide slide, string partForm, string timingId)
- {
- base.sid = timingId;
- base.slide = slide;
- this.rot = rot;
- this.groupShape = groupShape;
- base.id = id;
- base.top = top;
- base.left = left;
- base.width = width;
- base.height = height;
- base.invisible = invisible;
- base.animatable = animatable;
- base.index = index;
- base.type = "Group";
- base.partForm = partForm;
- }
- public Inner.PPTGroupShape groupShape { get; set; }
- public override List<Item> DrawElement()
- {
- Position position = new Position { cx = width, cy = height, x = left, y = top, rot = rot };
- var ShapeStyle = PPTXHelper.DoShapeProperties(groupShape.element.GroupShapeProperties, slide, type, partForm);
- Group group = new Group() { sid = sid,id = this.id, type = type, index = index/*, animatable = animatable, invisible = invisible */};
- group.style.border = ShapeStyle.border;
- group.style.fill = ShapeStyle.fill;
- group.style.effect = ShapeStyle.effect;
- group.style.position = position;
- group.uid = groupShape.suid;
- //SlideColor slideColor = PPTXHelper.DoShapeStyle(groupShape.element.ShapeStyle, slide, type);
- HtexSlide htexSlide = new HtexSlide(slide, slide.slideIndex)
- {
- ContainerShape = groupShape.containerShape,
- FromGroup = true
- };
- var elements= htexSlide.DrawElement();
- if (elements != null) {
- group.shapes = elements;
- }
- if (group.style.fill.type == -1|| group.style.border.color.type == 0)
- {
- group.style.fill = null;
- }
- if (group.style.border != null && (group.style.border.color.type == -1|| group.style.border.color.type == 0))
- {
- group.style.border.color = null;
- }
- if (group.style.border != null && group.style.border.type == "none")
- {
- group.style.border = null;
- }
- return new List<Item>() { group };
- }
- }
- }
|