Skip to content

Commit

Permalink
[morph] fix getting equal brush
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeyLuzyanin committed Jul 17, 2023
1 parent 27c4ae1 commit 9e654d4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions common/Drawings/Format/Format.js
Original file line number Diff line number Diff line change
Expand Up @@ -5337,6 +5337,11 @@
return true;
}
};
CUniFill.prototype.isGradientFill = function() {
if(this.fill && this.fill.type === c_oAscFill.FILL_TYPE_GRAD) {
return true;
}
};
CUniFill.prototype.checkTransparent = function() {
let oFill = this.fill;
if(oFill) {
Expand Down
5 changes: 4 additions & 1 deletion slide/Drawing/MorphTransition.js
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,10 @@
}
let oBrush = oBrush1;

if(oBrush1 && oBrush1.isSolidFill() && oBrush2 && oBrush2.isSolidFill()) {
if(oBrush1 && oBrush1.isEqual(oBrush2)) {
return oBrush1;
}
else if(oBrush1 && oBrush1.isSolidFill() && oBrush2 && oBrush2.isSolidFill()) {
const oRGBA1 = oBrush1.getRGBAColor();
const oRGBA2 = oBrush2.getRGBAColor();
const R = this.getValBetween(oRGBA1.R, oRGBA2.R) + 0.5 >> 0;
Expand Down

0 comments on commit 9e654d4

Please sign in to comment.