Skip to content

Commit

Permalink
Simplifly trail slice, see #29
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisklus committed Mar 30, 2023
1 parent b4c7718 commit 31e8ed7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions js/lab/view/CardCreatorNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ class CardCreatorNode extends Node {
iconNode.addInputListener( DragListener.createForwardingListener( ( event: PressListenerEvent ) => {

// Calculate the icon's origin.
let trail = screenView.getUniqueLeafTrailTo( iconNode );
trail = trail.slice( 1, trail.length );
let trail = screenView.getUniqueLeafTrailTo( iconNode ).slice( 1 );
const globalOrigin = trail.localToGlobalPoint( iconNode.localBounds.center );

let cardNode: CardNode;
Expand Down
3 changes: 1 addition & 2 deletions js/lab/view/LabScreenView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,7 @@ class LabScreenView<T extends NumberSuiteCommonPreferences> extends ScreenView {
tenFrame.countingObjects.clear();

// calculate icon's origin
let trail = this.getUniqueLeafTrailTo( this.tenFrameCreatorPanel.iconNode );
trail = trail.slice( 1, trail.length );
let trail = this.getUniqueLeafTrailTo( this.tenFrameCreatorPanel.iconNode ).slice( 1 );
const globalOrigin = trail.localToGlobalPoint( this.tenFrameCreatorPanel.iconNode.localBounds.leftTop );

const removeAnimation = new Animation( {
Expand Down

0 comments on commit 31e8ed7

Please sign in to comment.