Skip to content

Commit

Permalink
Image options for icons. #115
Browse files Browse the repository at this point in the history
  • Loading branch information
Denz1994 committed Mar 18, 2020
1 parent 42667d4 commit 5ea6c83
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions js/common/view/BAMIconFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,11 @@ const BAMIconFactory = {
moleculeNodeTwo.transformMolecule( transformMatrix );
}
moleculeNodeTwo.draw();
const moleculeIconTwo = new Image( moleculeNodeTwo.canvas.toDataURL(), { scale: .50 } );
const moleculeIconTwo = new Image( moleculeNodeTwo.canvas.toDataURL(), {
initialWidth: moleculeNodeOne.canvas.width,
initialHeight: moleculeNodeOne.canvas.height,
scale: .50
} );

// Wrapper node to house molecule icons
const wrapperNode = new Rectangle( 0, 0, 548, 373, 0, 0, {
Expand All @@ -93,8 +97,8 @@ const BAMIconFactory = {
wrapperNode.addChild( moleculeIconTwo );

// Adjust the position of the molecule icons.
moleculeIconOne.center = wrapperNode.center.minusXY( 120, 0 );
moleculeIconTwo.center = wrapperNode.center.plusXY( 0, -93 );
moleculeIconOne.center = wrapperNode.center.minusXY( 125, 0 );
moleculeIconTwo.center = wrapperNode.center.plusXY( 115, 0 );

return new ScreenIcon( new Node( {
children: [ wrapperNode ]
Expand Down

0 comments on commit 5ea6c83

Please sign in to comment.