aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rwxr-xr-xjs/panels/color/colorpanelbase.reel/colorpanelbase.js59
1 files changed, 23 insertions, 36 deletions
diff --git a/js/panels/color/colorpanelbase.reel/colorpanelbase.js b/js/panels/color/colorpanelbase.reel/colorpanelbase.js
index 24eb86ea..855d4afa 100755
--- a/js/panels/color/colorpanelbase.reel/colorpanelbase.js
+++ b/js/panels/color/colorpanelbase.reel/colorpanelbase.js
@@ -982,58 +982,45 @@ exports.ColorPanelBase = Montage.create(Component, {
982 _updateValueFromSH: { 982 _updateValueFromSH: {
983 value: function (e) { 983 value: function (e) {
984 // 984 //
985 var update; 985 var update, type;
986 // 986 //
987 if (!e._event.wasSetByCode) { 987 if (!e._event.wasSetByCode) {
988 //
989 if (!e.target.cInputType) {
990 type = 'hottext';
991 } else {
992 type = 'slider'
993 }
994 //
988 if (e.target.changesColor) { 995 if (e.target.changesColor) {
989 // 996 //
990 //this.application.ninja.colorController.colorPopupManager.hideColorPopup();
991 //
992 if (this.panelMode === 'rgb') { 997 if (this.panelMode === 'rgb') {
993 if (e.target.cInputType === 'slider') { 998 //
994 // 999 if (this.colorManager.rgb && Math.round(this._combo[0][type].value) === this.colorManager.rgb.r && Math.round(this._combo[1][type].value) === this.colorManager.rgb.g && Math.round(this._combo[2][type].value) === this.colorManager.rgb.b) {
995 if (this.colorManager.rgb && Math.round(this._combo[0].slider.value) === this.colorManager.rgb.r && Math.round(this._combo[1].slider.value) === this.colorManager.rgb.g && Math.round(this._combo[2].slider.value) === this.colorManager.rgb.b) { 1000 return;
996 return;
997 }
998 //
999 update = { r: Math.round(this._combo[0].slider.value), g: Math.round(this._combo[1].slider.value), b: Math.round(this._combo[2].slider.value) };
1000 } else {
1001 //
1002 if (this.colorManager.rgb && Math.round(this._combo[0].hottext.value) === this.colorManager.rgb.r && Math.round(this._combo[1].hottext.value) === this.colorManager.rgb.g && Math.round(this._combo[2].hottext.value) === this.colorManager.rgb.b) {
1003 return;
1004 }
1005 //
1006 update = { r: Math.round(this._combo[0].hottext.value), g: Math.round(this._combo[1].hottext.value), b: Math.round(this._combo[2].hottext.value) };
1007 } 1001 }
1002 //
1003 update = { r: Math.round(this._combo[0][type].value), g: Math.round(this._combo[1][type].value), b: Math.round(this._combo[2][type].value) };
1004 //
1008 update.wasSetByCode = false; 1005 update.wasSetByCode = false;
1009 update.type = 'change'; 1006 update.type = 'change';
1010 this.colorManager.rgb = update; 1007 this.colorManager.rgb = update;
1011 } else if (this.panelMode === 'hsl') { 1008 } else if (this.panelMode === 'hsl') {
1012 if (e.target.cInputType === 'slider') { 1009 //
1013 // 1010 if (this.colorManager.hsl && Math.round(this._combo[0][type].value) === this.colorManager.hsl.h && Math.round(this._combo[1][type].value) === this.colorManager.hsl.s && Math.round(this._combo[2][type].value) === this.colorManager.hsl.l) {
1014 if (this.colorManager.hsl && Math.round(this._combo[0].slider.value) === this.colorManager.hsl.h && Math.round(this._combo[1].slider.value) === this.colorManager.hsl.s && Math.round(this._combo[2].slider.value) === this.colorManager.hsl.l) { 1011 return;
1015 return;
1016 }
1017 //
1018 update = { h: Math.round(this._combo[0].slider.value), s: Math.round(this._combo[1].slider.value), l: Math.round(this._combo[2].slider.value) };
1019 } else {
1020 //
1021 if (this.colorManager.hsl && Math.round(this._combo[0].hottext.value) === this.colorManager.hsl.h && Math.round(this._combo[1].hottext.value) === this.colorManager.hsl.s && Math.round(this._combo[2].hottext.value) === this.colorManager.hsl.l) {
1022 return;
1023 }
1024 //
1025 update = { h: Math.round(this._combo[0].hottext.value), s: Math.round(this._combo[1].hottext.value), l: Math.round(this._combo[2].hottext.value) };
1026 } 1012 }
1013 //
1014 update = { h: Math.round(this._combo[0][type].value), s: Math.round(this._combo[1][type].value), l: Math.round(this._combo[2][type].value) };
1015 //
1027 update.wasSetByCode = false; 1016 update.wasSetByCode = false;
1028 update.type = 'change'; 1017 update.type = 'change';
1029 this.colorManager.hsl = update; 1018 this.colorManager.hsl = update;
1030 } 1019 }
1031 } else { 1020 } else {
1032 if (e.target.cInputType === 'slider') { 1021 //
1033 update = { value: this._combo[3].slider.value / 100, wasSetByCode: false, type: 'change' }; 1022 update = { value: this._combo[3][type].value / 100, wasSetByCode: false, type: 'change' };
1034 } else { 1023 //
1035 update = { value: this._combo[3].hottext.value / 100, wasSetByCode: false, type: 'change' };
1036 }
1037 this.colorManager.alpha = update; 1024 this.colorManager.alpha = update;
1038 } 1025 }
1039 } 1026 }