Skip to main content

Module group

Module group 

Source
Expand description

Group:组合形状。

组合是把多个形状“打包“为一个整体——移动、旋转、缩放时内部子形状按 相对位置一起变换。OOXML 用 <p:grpSp> 容器 + <a:chOff> / <a:chExt> 表达子坐标系。

§与 python-pptx 的对应

  • pptx.shapes.group.Group ←→ Group
  • pptx.shapes.group.GroupShape(与 Shape 同源)←→ GroupChild

§坐标系

Group 自身有 off / ext 表示“组合在父 slide 中的位置 + 尺寸“; chOff / chExt 是子坐标系(默认与 off/ext 相同)。 修改 group 自身位置时同时 mutate self.group.off(参见 Shape::set_left 实现)。

§限制

  • 递归 Group(Group 嵌套 Group)已支持;
  • 子形状可读取,也可通过 Group::add_child / Group::remove_child 增删。

Structs§

Group
组合形状。

Enums§

GroupChild
高阶 GroupChild 枚举。