aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--assets/canvas-runtime.js493
-rwxr-xr-xcss/ninja.css14
-rw-r--r--js/components/converter/string-units-converter.js2
-rw-r--r--js/components/converter/string-value-converter.js2
-rwxr-xr-xjs/components/layout/bread-crumb.reel/bread-crumb.js42
-rwxr-xr-xjs/components/tools-properties/fill-properties.reel/fill-properties.html41
-rwxr-xr-xjs/components/tools-properties/fill-properties.reel/fill-properties.js19
-rwxr-xr-xjs/components/tools-properties/ink-bottle-properties.reel/ink-bottle-properties.css15
-rwxr-xr-xjs/components/tools-properties/ink-bottle-properties.reel/ink-bottle-properties.html116
-rwxr-xr-xjs/components/tools-properties/ink-bottle-properties.reel/ink-bottle-properties.js28
-rwxr-xr-xjs/components/tools-properties/pen-properties.reel/pen-properties.js27
-rwxr-xr-xjs/controllers/document-controller.js22
-rwxr-xr-xjs/controllers/elements/body-controller.js9
-rwxr-xr-xjs/controllers/elements/controller-factory.js4
-rwxr-xr-xjs/controllers/elements/element-controller.js106
-rwxr-xr-xjs/controllers/elements/shapes-controller.js103
-rwxr-xr-xjs/controllers/selection-controller.js38
-rwxr-xr-xjs/controllers/styles-controller.js4
-rwxr-xr-xjs/data/menu-data.js12
-rwxr-xr-xjs/data/pi/pi-data.js10
-rwxr-xr-xjs/data/tools-data.js4
-rwxr-xr-xjs/document/document-html.js20
-rwxr-xr-xjs/document/helpers/webgl-helper.js14
-rwxr-xr-xjs/document/mediators/template.js100
-rwxr-xr-xjs/document/models/base.js81
-rwxr-xr-xjs/document/models/html.js55
-rw-r--r--js/document/templates/app/main.js1
-rwxr-xr-xjs/document/templates/banner/index.html47
-rwxr-xr-xjs/document/templates/html/index.html50
-rwxr-xr-xjs/document/views/design.js92
-rwxr-xr-xjs/helper-classes/3D/draw-utils.js4
-rwxr-xr-xjs/helper-classes/3D/math-utils.js11
-rwxr-xr-xjs/helper-classes/3D/snap-manager.js20
-rw-r--r--js/io/system/ninjalibrary.json2
-rw-r--r--js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js5
-rwxr-xr-xjs/lib/NJUtils.js124
-rwxr-xr-xjs/lib/geom/brush-stroke.js1352
-rwxr-xr-xjs/lib/geom/sub-path.js331
-rwxr-xr-xjs/mediators/drag-drop-mediator.js2
-rwxr-xr-xjs/mediators/element-mediator.js123
-rw-r--r--js/mediators/io-mediator.js10
-rwxr-xr-xjs/mediators/keyboard-mediator.js7
-rwxr-xr-xjs/models/element-model.js100
-rwxr-xr-xjs/ninja.reel/ninja.html3
-rwxr-xr-xjs/ninja.reel/ninja.js20
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js28
-rwxr-xr-xjs/panels/components-panel.reel/components-panel.js22
-rwxr-xr-xjs/panels/properties.reel/properties.js4
-rwxr-xr-xjs/panels/properties.reel/sections/custom.reel/custom.js2
-rw-r--r--js/panels/resize-composer.js5
-rwxr-xr-xjs/stage/layout.js6
-rwxr-xr-xjs/stage/stage.reel/stage.js149
-rw-r--r--js/tools/BrushTool.js17
-rwxr-xr-xjs/tools/EyedropperTool.js1
-rwxr-xr-xjs/tools/FillTool.js33
-rwxr-xr-xjs/tools/InkBottleTool.js50
-rwxr-xr-xjs/tools/LineTool.js109
-rwxr-xr-xjs/tools/PenTool.js445
-rwxr-xr-xjs/tools/Rotate3DToolBase.js2
-rwxr-xr-xjs/tools/SelectionTool.js118
-rwxr-xr-xjs/tools/ShapeTool.js51
-rwxr-xr-xjs/tools/TagTool.js15
-rwxr-xr-xjs/tools/TranslateObject3DTool.js2
-rwxr-xr-xjs/tools/drawing-tool.js3
-rwxr-xr-xjs/tools/modifier-tool-base.js2
-rwxr-xr-xscss/imports/scss/_ScrollBars.scss26
66 files changed, 3029 insertions, 1746 deletions
diff --git a/assets/canvas-runtime.js b/assets/canvas-runtime.js
index afb9563e..753161aa 100644
--- a/assets/canvas-runtime.js
+++ b/assets/canvas-runtime.js
@@ -382,6 +382,16 @@ NinjaCvsRt.GLRuntime = Object.create(Object.prototype, {
382 obj.importJSON( jObj ); 382 obj.importJSON( jObj );
383 break; 383 break;
384 384
385 case 5: //subpath (created by pen tool)
386 obj = Object.create(NinjaCvsRt.RuntimeSubPath, {_materials: { value:[], writable:true}});
387 obj.importJSON (jObj );
388 break;
389
390 case 6: //brushstroke (created by brush tool)
391 obj = Object.create(NinjaCvsRt.RuntimeBrushStroke, {_materials: { value:[], writable:true}});
392 obj.importJSON (jObj );
393 break;
394
385 default: 395 default:
386 throw new Error( "Attempting to load unrecognized object type: " + type ); 396 throw new Error( "Attempting to load unrecognized object type: " + type );
387 break; 397 break;
@@ -524,6 +534,7 @@ NinjaCvsRt.RuntimeGeomObj = Object.create(Object.prototype, {
524 GEOM_TYPE_LINE: { value: 3, writable: false }, 534 GEOM_TYPE_LINE: { value: 3, writable: false },
525 GEOM_TYPE_PATH: { value: 4, writable: false }, 535 GEOM_TYPE_PATH: { value: 4, writable: false },
526 GEOM_TYPE_CUBIC_BEZIER: { value: 5, writable: false }, 536 GEOM_TYPE_CUBIC_BEZIER: { value: 5, writable: false },
537 GEOM_TYPE_BRUSH_STROKE: { value: 6, writable: false },
527 GEOM_TYPE_UNDEFINED: { value: -1, writable: false }, 538 GEOM_TYPE_UNDEFINED: { value: -1, writable: false },
528 539
529 /////////////////////////////////////////////////////////////////////// 540 ///////////////////////////////////////////////////////////////////////
@@ -2144,3 +2155,485 @@ NinjaCvsRt.RuntimePlasmaMaterial = Object.create(NinjaCvsRt.RuntimeMaterial, {
2144}); 2155});
2145 2156
2146 2157
2158
2159// **************************************************************************
2160// Runtime for the pen tool path
2161// **************************************************************************
2162NinjaCvsRt.AnchorPoint = Object.create(Object.prototype, {
2163 /////////////////////////////////////////
2164 // Instance variables
2165 /////////////////////////////////////////
2166 _x: {value: 0.0, writable: true},
2167 _y: {value: 0.0, writable: true},
2168 _z: {value: 0.0, writable: true},
2169
2170 _prevX: {value: 0.0, writable: true},
2171 _prevY: {value: 0.0, writable: true},
2172 _prevZ: {value: 0.0, writable: true},
2173
2174 _nextX: {value: 0.0, writable: true},
2175 _nextY: {value: 0.0, writable: true},
2176 _nextZ: {value: 0.0, writable: true},
2177
2178 // *********** setters ************
2179 setPos: {
2180 value: function(x,y,z){
2181 this._x = x;
2182 this._y = y;
2183 this._z = z;
2184 }
2185 },
2186
2187 setPrevPos: {
2188 value: function (x, y, z) {
2189 this._prevX = x;
2190 this._prevY = y;
2191 this._prevZ = z;
2192 }
2193 },
2194
2195 setNextPos: {
2196 value: function (x, y, z) {
2197 this._nextX = x;
2198 this._nextY = y;
2199 this._nextZ = z;
2200 }
2201 },
2202
2203 // *************** getters ******************
2204 // (add as needed)
2205 getPosX: {
2206 value: function () {
2207 return this._x;
2208 }
2209 },
2210
2211 getPosY: {
2212 value: function () {
2213 return this._y;
2214 }
2215 },
2216
2217 getPosZ: {
2218 value: function () {
2219 return this._z;
2220 }
2221 },
2222
2223 getPrevX: {
2224 value: function () {
2225 return this._prevX;
2226 }
2227 },
2228
2229 getPrevY: {
2230 value: function () {
2231 return this._prevY;
2232 }
2233 },
2234
2235 getPrevZ: {
2236 value: function () {
2237 return this._prevZ;
2238 }
2239 },
2240
2241 getNextX: {
2242 value: function () {
2243</