fix wireframes. start to modularize color and opacity
This commit is contained in:
parent
b2c59cd739
commit
36682581f0
2 changed files with 14 additions and 5 deletions
|
|
@ -691,7 +691,7 @@ var gs_kiri_init = exports;
|
||||||
platform.layout();
|
platform.layout();
|
||||||
break;
|
break;
|
||||||
case cca('w'): // toggle wireframe on widgets
|
case cca('w'): // toggle wireframe on widgets
|
||||||
toggleWireframe(wireframe_color, wireframe_model_opacity);
|
API.view.wireframe(API.color.wireframe, API.opacity.wireframe);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
API.event.emit('keypress', evt);
|
API.event.emit('keypress', evt);
|
||||||
|
|
|
||||||
17
js/kiri.js
17
js/kiri.js
|
|
@ -52,8 +52,6 @@ self.kiri.license = exports.LICENSE;
|
||||||
localFilters = js2o(SDB.getItem(localFilterKey)) || [],
|
localFilters = js2o(SDB.getItem(localFilterKey)) || [],
|
||||||
OCTOPRINT = null,
|
OCTOPRINT = null,
|
||||||
// ---------------
|
// ---------------
|
||||||
wireframe_color = 0x444444,
|
|
||||||
wireframe_model_opacity = 0.25,
|
|
||||||
widget_selected_color = 0xbbff00,
|
widget_selected_color = 0xbbff00,
|
||||||
widget_deselected_color = 0xffff00,
|
widget_deselected_color = 0xffff00,
|
||||||
widget_slicing_color = 0xffaaaa,
|
widget_slicing_color = 0xffaaaa,
|
||||||
|
|
@ -124,6 +122,14 @@ self.kiri.license = exports.LICENSE;
|
||||||
load_files: loadFiles
|
load_files: loadFiles
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const color = {
|
||||||
|
wireframe: 0x444444
|
||||||
|
};
|
||||||
|
|
||||||
|
const opacity = {
|
||||||
|
wireframe: 0.25
|
||||||
|
};
|
||||||
|
|
||||||
const API = KIRI.api = {
|
const API = KIRI.api = {
|
||||||
ui: UI,
|
ui: UI,
|
||||||
uc: UC,
|
uc: UC,
|
||||||
|
|
@ -142,6 +148,7 @@ self.kiri.license = exports.LICENSE;
|
||||||
show: showSettings,
|
show: showSettings,
|
||||||
update: updateSettings
|
update: updateSettings
|
||||||
},
|
},
|
||||||
|
color,
|
||||||
const: {
|
const: {
|
||||||
SEED,
|
SEED,
|
||||||
LANG,
|
LANG,
|
||||||
|
|
@ -199,6 +206,7 @@ self.kiri.license = exports.LICENSE;
|
||||||
moved : function() { return mouseMoved },
|
moved : function() { return mouseMoved },
|
||||||
movedSet : function(b) { mouseMoved = b }
|
movedSet : function(b) { mouseMoved = b }
|
||||||
},
|
},
|
||||||
|
opacity,
|
||||||
probe: {
|
probe: {
|
||||||
local : function() { return false },
|
local : function() { return false },
|
||||||
grid : function() { return false },
|
grid : function() { return false },
|
||||||
|
|
@ -223,7 +231,8 @@ self.kiri.license = exports.LICENSE;
|
||||||
view: {
|
view: {
|
||||||
get: function() { return viewMode },
|
get: function() { return viewMode },
|
||||||
set: setViewMode,
|
set: setViewMode,
|
||||||
update_fields: updateFields
|
update_fields: updateFields,
|
||||||
|
wireframe: toggleWireframe
|
||||||
},
|
},
|
||||||
widgets: {
|
widgets: {
|
||||||
new: newWidget,
|
new: newWidget,
|
||||||
|
|
@ -1125,7 +1134,7 @@ self.kiri.license = exports.LICENSE;
|
||||||
// on done
|
// on done
|
||||||
widget.render(renderMode, MODE === MODES.CAM);
|
widget.render(renderMode, MODE === MODES.CAM);
|
||||||
// clear wireframe
|
// clear wireframe
|
||||||
widget.setWireframe(false, wireframe_color, wireframe_model_opacity);
|
widget.setWireframe(false, color.wireframe, opacity.wireframe);
|
||||||
widget.setOpacity(settings.mode === 'CAM' ? sliced_opacity_cam : sliced_opacity);
|
widget.setOpacity(settings.mode === 'CAM' ? sliced_opacity_cam : sliced_opacity);
|
||||||
widget.setColor(widget_deselected_color);
|
widget.setColor(widget_deselected_color);
|
||||||
// update UI info
|
// update UI info
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue