Skip to content

Commit

Permalink
feat: update
Browse files Browse the repository at this point in the history
  • Loading branch information
qq15725 committed Dec 6, 2024
1 parent 9360e7f commit fb33ef8
Showing 4 changed files with 21 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/openxml/drawing/_Fill.ts
Original file line number Diff line number Diff line change
@@ -38,4 +38,14 @@ export class _Fill extends OXML {
}
return undefined
}

get fillImage(): string | undefined {
if (this.noFill) {
return undefined
}
else if (this.blipFill) {
return this.blipFill.blip?.rEmbed
}
return undefined
}
}
2 changes: 1 addition & 1 deletion src/openxml/presentation/Picture.ts
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ export class Picture extends OXML {
@defineProperty('nvPicPr.cNvPr.id') declare id: string
@defineProperty('nvPicPr.cNvPr.name') declare name: string
@defineProperty() style = new _PictureStyle(this)
@defineProperty('blipFill.blip.rEmbed') declare rEmbed: string
@defineProperty('blipFill.blip.rEmbed') declare src: string
}

export class _PictureStyle extends OXML {
5 changes: 5 additions & 0 deletions src/openxml/presentation/Shape.ts
Original file line number Diff line number Diff line change
@@ -38,6 +38,7 @@ export class Shape extends OXML {

export class _ShapeStyle extends OXML {
@defineProperty('_backgroundColor') declare backgroundColor?: string
@defineProperty('_backgroundImage') declare backgroundImage?: string
@defineProperty('_parent.spPr.xfrm.off.x') declare left: number
@defineProperty('_parent.spPr.xfrm.off.y') declare top: number
@defineProperty('_parent.spPr.xfrm.ext.cx') declare width: number
@@ -60,6 +61,10 @@ export class _ShapeStyle extends OXML {
return this._parent.spPr.fillColor
}

protected get _backgroundImage(): string | undefined {
return this._parent.spPr.fillImage
}

protected get _writingMode(): 'horizontal-tb' | 'vertical-lr' | 'vertical-rl' | undefined {
switch (this._parent.txBody.bodyPr.upright) {
case true:
5 changes: 5 additions & 0 deletions src/openxml/presentation/Slide.ts
Original file line number Diff line number Diff line change
@@ -22,11 +22,16 @@ export class Slide extends _Slide {

export class _SlideStyle extends OXML {
@defineProperty('_backgroundColor') declare backgroundColor?: string
@defineProperty('_backgroundImage') declare backgroundImage?: string

protected get _backgroundColor(): string | undefined {
return this._parent.cSld.bg?.bgPr.fillColor
}

protected get _backgroundImage(): string | undefined {
return this._parent.cSld.bg?.bgPr.fillImage
}

constructor(
protected _parent: Slide,
) {

0 comments on commit fb33ef8

Please sign in to comment.