Skip to content

Commit

Permalink
Add for ghost
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Hartmann committed Nov 21, 2020
1 parent 0445329 commit 595da12
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions src/extensions/renderer/canvas/drawing-nodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ CRp.drawNode = function( context, node, shiftToOriginWithBb, drawLabel = true, s
r.drawElementText( context, node, null, drawLabel );
};

let bgContainment = node.pstyle('background-image-containment').value;
let ghost = node.pstyle('ghost').value === 'yes';

if( ghost ){
Expand All @@ -264,19 +265,30 @@ CRp.drawNode = function( context, node, shiftToOriginWithBb, drawLabel = true, s

context.translate( gx, gy );

setupShapeColor( ghostOpacity * bgOpacity );
drawShape();
drawImages( effGhostOpacity );
drawPie( darkness !== 0 || borderWidth !== 0 );
darken( effGhostOpacity );
setupBorderColor( ghostOpacity * borderOpacity );
drawBorder();
if ( bgContainment === 'inside' ) {
setupShapeColor( ghostOpacity * bgOpacity );
drawShape();
drawImages( effGhostOpacity );
drawPie( darkness !== 0 || borderWidth !== 0 );
darken( effGhostOpacity );
setupBorderColor( ghostOpacity * borderOpacity );
drawBorder();
}

if ( bgContainment === 'over' ) {
setupShapeColor( ghostOpacity * bgOpacity );
drawShape();
setupBorderColor( ghostOpacity * borderOpacity );
drawBorder();
drawPie( darkness !== 0 || borderWidth !== 0 );
darken( effGhostOpacity );
drawImages( effGhostOpacity );
}

context.translate( -gx, -gy );
}

let bgContainment = node.pstyle('background-image-containment').value;


if ( bgContainment === 'inside' ) {
setupShapeColor();
drawShape();
Expand Down

0 comments on commit 595da12

Please sign in to comment.