Skip to content

Commit

Permalink
23/02/24 error background color
Browse files Browse the repository at this point in the history
  • Loading branch information
iPetyo committed Feb 23, 2024
1 parent 684a6b9 commit 8d9a4d6
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 29 deletions.
3 changes: 1 addition & 2 deletions src/app/pages/editor/components/menubar.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
vm.ArrayComposites = [];
vm.ArrayCompositesNew = [];
vm.models = [];
vm.date = "version 06/02/23";
vm.date = "version 23/02/23";
vm.showHelp = showHelp;
vm.showVideo = showVideo;
vm.TreesExample = TreesExample;
Expand Down Expand Up @@ -160,7 +160,6 @@
} else {
vm.isEditor = "editor";
}
console.log(vm.isEditor);
}


Expand Down
59 changes: 32 additions & 27 deletions src/editor/editor/Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@
this._systems.push(new b3e.editor.ShortcutSystem(this));

// SETTINGS

this.applySettings('default');
this.applySettings('default',this._settings);
};

/**
Expand All @@ -77,7 +77,7 @@
p._update = function () {
//udate canvas button [more like this?]
if (this.canvasSub) {
this.canvasSub.style.width = window.innerWidth < 1400 ? "400px" : window.innerWidth / 3.5 + "px";
this.canvasSub.style.width = window.innerWidth < 1400 ? "400px" : window.innerWidth / 3.5 + "px";
this.canvasSub.style.height = window.innerHeight < 747 ? "250px" : window.innerHeight / 3.5 + "px";
}

Expand All @@ -97,9 +97,14 @@
this.dispatchEvent(event);
};

p.applySettings = function (settings) {
p.applySettings = function (settings,SubSettings) {
if (settings === 'default') {
settings = b3e.DEFAULT_SETTINGS;
if (Object.keys(SubSettings._dict).length) {
settings = SubSettings._dict;
}else{
settings = b3e.DEFAULT_SETTINGS;
}

this._settings.clear();
}

Expand All @@ -117,30 +122,30 @@
};

p.applySettingsFormatOnlyNode = function (div, blockTitle, category) {
var p = this.project.get();
var tree = p.trees.getSelected();
var block = new b3e.Block(blockTitle);
var canvas = document.createElement('canvas');
block.category = category,
var p = this.project.get();
var tree = p.trees.getSelected();
var block = new b3e.Block(blockTitle);

var canvas = document.createElement('canvas');

block.category = category,
block.title = blockTitle,
block._applySettings(this._settings);
block.x = block._width/1.2;
block.y = block._height*1.2;

canvas.setAttribute('width', block._width/1.2 * tree.scaleX * 2);
canvas.setAttribute('height', block._height*1.2 * tree.scaleY * 2);
canvas.style.border = '3px solid black';
canvas.style.backgroundColor = '#2f2f2f';

var stage = new createjs.Stage(canvas);
stage.scaleX = 1;
stage.scaleY = 1;
stage.addChild(block);
stage.update();
div.appendChild(canvas);
block.x = block._width / 1.2;
block.y = block._height * 1.2;

canvas.setAttribute('width', block._width / 1.2 * tree.scaleX * 2);
canvas.setAttribute('height', block._height * 1.2 * tree.scaleY * 2);
canvas.style.border = '3px solid black';
canvas.style.backgroundColor = '#2f2f2f';

var stage = new createjs.Stage(canvas);
stage.scaleX = 1;
stage.scaleY = 1;
stage.addChild(block);
stage.update();
div.appendChild(canvas);

return canvas;
}

Expand Down

0 comments on commit 8d9a4d6

Please sign in to comment.