* NodeEditor UI - add confirmation on clic to "new" button - modify bezier controle point distance to improve draw of small nodes distances * esLint
@@ -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();
@@ -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( () => {