diff options
Diffstat (limited to 'js/tools/FillTool.js')
-rwxr-xr-x | js/tools/FillTool.js | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/js/tools/FillTool.js b/js/tools/FillTool.js index 66dd9305..e08ec1da 100755 --- a/js/tools/FillTool.js +++ b/js/tools/FillTool.js | |||
@@ -70,25 +70,32 @@ exports.FillTool = Montage.create(ModifierToolBase, { | |||
70 | // Called by modifier tool base's HandleLeftButtonDown after updating selection (if needed) | 70 | // Called by modifier tool base's HandleLeftButtonDown after updating selection (if needed) |
71 | startDraw: { | 71 | startDraw: { |
72 | value: function(event) { | 72 | value: function(event) { |
73 | this.drawData = null; | ||
73 | this.isDrawing = true; | 74 | this.isDrawing = true; |
74 | 75 | ||
75 | if(this._canColor && this.application.ninja.selectedElements.length) { | 76 | if(this._canColor && this.application.ninja.selectedElements.length) { |
77 | var fillInfo = {}, | ||
78 | color; | ||
79 | if(this.options.useFillColor.checked) { | ||
80 | fillInfo.colorInfo = {}; | ||
81 | color = this.options.fill; | ||
82 | if(color && color.color) | ||
83 | { | ||
84 | fillInfo.colorInfo.mode = color.colorMode; | ||
85 | fillInfo.colorInfo.color = color.color; | ||
86 | } else { | ||
87 | fillInfo.colorInfo.mode = "nocolor"; | ||
88 | fillInfo.colorInfo.color = null; | ||
89 | } | ||
90 | } | ||
76 | 91 | ||
77 | var color = this.options.fill, | 92 | if(this.options.useWebGL.checked) { |
78 | colorInfo; | 93 | fillInfo.webGLInfo = {}; |
79 | if(color && color.color) | 94 | fillInfo.webGLInfo.material = this.options.fillMaterial.value; |
80 | { | ||
81 | colorInfo = { mode:color.colorMode, | ||
82 | color:color.color | ||
83 | }; | ||
84 | } | 95 | } |
85 | else | 96 | if(fillInfo.colorInfo || fillInfo.webGLInfo) { |
86 | { | 97 | ElementsMediator.setFill(this.application.ninja.selectedElements, fillInfo, "Change", "fillTool"); |
87 | colorInfo = { mode:"nocolor", | ||
88 | color:color.color | ||
89 | }; | ||
90 | } | 98 | } |
91 | ElementsMediator.setColor(this.application.ninja.selectedElements, colorInfo, true, "Change", "fillTool"); | ||
92 | } | 99 | } |
93 | } | 100 | } |
94 | } | 101 | } |