Skip to content

Commit

Permalink
NodeEditor UI (#23312)
Browse files Browse the repository at this point in the history
* NodeEditor UI
- add confirmation on clic to "new" button
- modify bezier controle point distance to improve draw of small nodes distances

* esLint
  • Loading branch information
fyoudine authored Jan 24, 2022
1 parent 0c31bc6 commit 338e193
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion examples/jsm/libs/flow.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -1645,7 +1645,9 @@ class TitleElement extends DraggableElement {

const drawLine = ( p1x, p1y, p2x, p2y, invert, size, colorA, ctx, colorB = null ) => {

const offset = 100 * ( invert ? - 1 : 1 );
const dx = p2x - p1x;
const dy = p2y - p1y;
const offset = Math.sqrt( dx*dx + dy*dy ) * (invert ? -.3 : .3) ;

ctx.beginPath();

Expand Down
6 changes: 5 additions & 1 deletion examples/jsm/node-editor/NodeEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,11 @@ export class NodeEditor extends EventDispatcher {
menuButton.onClick( () => this.nodesContext.open() );
examplesButton.onClick( () => this.examplesContext.open() );

newButton.onClick( () => this.newProject() );
newButton.onClick( () => {

if ( confirm( 'are you sure' ) ) this.newProject();

} );

openButton.onClick( () => {

Expand Down

0 comments on commit 338e193

Please sign in to comment.