Skip to content

Commit

Permalink
fix drawing shadow
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeyLuzyanin committed Oct 24, 2023
1 parent 7829c47 commit d118cf0
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions common/Drawings/Format/GraphicObjectBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -1108,12 +1108,8 @@
if (outerShdw.sy) {
H *= outerShdw.sy / 100000;
}
// W += penW;
// H += penW;
if (W < this.extX + penW) {
if(AscFormat.fApproxEqual(W, this.extX) && AscFormat.fApproxEqual(H, this.extY)) {
W = this.extX + penW + 1;
}
if (H < this.extY + penW) {
H = this.extY + penW + 1;
}
shape.spPr.xfrm.setExtX(W);
Expand Down Expand Up @@ -1192,8 +1188,14 @@
var oTransform = new AscCommon.CMatrix();
var dist = outerShdw.dist ? outerShdw.dist / 36000 : 0;
var dir = outerShdw.dir ? outerShdw.dir : 0;
oTransform.tx = dist * Math.cos(AscFormat.cToRad * dir) - (this.shdwSp.extX - this.extX) / 2.0;
oTransform.ty = dist * Math.sin(AscFormat.cToRad * dir) - (this.shdwSp.extY - this.extY) / 2.0;
if(this.shdwSp.extX < this.extX && this.shdwSp.extY < this.extY) {
oTransform.tx = dist * Math.cos(AscFormat.cToRad * dir);
oTransform.ty = dist * Math.sin(AscFormat.cToRad * dir);
}
else {
oTransform.tx = dist * Math.cos(AscFormat.cToRad * dir) - (this.shdwSp.extX - this.extX) / 2.0;
oTransform.ty = dist * Math.sin(AscFormat.cToRad * dir) - (this.shdwSp.extY - this.extY) / 2.0;
}
global_MatrixTransformer.MultiplyAppend(oTransform, this.transform);
this.shdwSp.bounds.x = this.bounds.x + this.shdwSp.bounds.l;
this.shdwSp.bounds.y = this.bounds.y + this.shdwSp.bounds.t;
Expand Down

0 comments on commit d118cf0

Please sign in to comment.