JavaScriptを色々あれこれしようとするがひたすら失敗を繰り返している
| Revision | 33 (tree) |
|---|---|
| Time | 2016-11-29 18:54:42 |
| Author | |
(empty log message)
| @@ -27,7 +27,6 @@ | ||
| 27 | 27 | |
| 28 | 28 | // DOMをクリア |
| 29 | 29 | this.initDOMobj(); |
| 30 | -// this.renderFunc = new Queue(); | |
| 31 | 30 | |
| 32 | 31 | |
| 33 | 32 | this.dropinitsize = 100.0; // File dropで作成する Elementの長辺の長さ |
| @@ -74,20 +73,6 @@ | ||
| 74 | 73 | } |
| 75 | 74 | |
| 76 | 75 | |
| 77 | - | |
| 78 | - /* | |
| 79 | - // ブラウザ上への描画 ------------------------- | |
| 80 | - | |
| 81 | - // コマンド要求実行後の描画共通処理 | |
| 82 | - // requestAnimationFrameのcallbackから呼び出される | |
| 83 | - render() { | |
| 84 | - while (0 < this.renderFunc.size()) { | |
| 85 | - let renderFunction = this.renderFunc.dequeue(); | |
| 86 | - renderFunction(); | |
| 87 | - } | |
| 88 | - } | |
| 89 | - */ | |
| 90 | - | |
| 91 | 76 | // コマンド実行処理 ----------------------------- |
| 92 | 77 | |
| 93 | 78 | // DIV Box作成 |
| @@ -140,7 +125,6 @@ | ||
| 140 | 125 | } |
| 141 | 126 | else { |
| 142 | 127 | // 描画呼び出し時に呼び出す関数を登録 |
| 143 | -// this.renderFunc.enqueue(this.renderCreate.bind(this)); | |
| 144 | 128 | window.renderLoop.requestRenderFunc(this.renderCreate.bind(this)); |
| 145 | 129 | } |
| 146 | 130 | } |
| @@ -153,7 +137,6 @@ | ||
| 153 | 137 | reader.onload = function (evt) { |
| 154 | 138 | this.text = evt.target.result; |
| 155 | 139 | // 描画呼び出し時に呼び出す関数を登録 |
| 156 | -// this.renderFunc.enqueue(this.renderCreate.bind(this)); | |
| 157 | 140 | window.renderLoop.requestRenderFunc(this.renderCreate.bind(this)); |
| 158 | 141 | }.bind(this); |
| 159 | 142 | } |
| @@ -175,7 +158,6 @@ | ||
| 175 | 158 | this.DOMobject.dataset.orgwidth = this.originalWidth; // transform: scaleの基準サイズ |
| 176 | 159 | this.DOMobject.dataset.orgheight = this.originalHeight; // 画像original sizeなのでこちらで管理 |
| 177 | 160 | // 表示サイズ取得完了したので画面に表示 |
| 178 | -// this.renderFunc.enqueue(this.renderCreate.bind(this)); | |
| 179 | 161 | window.renderLoop.requestRenderFunc(this.renderCreate.bind(this)); |
| 180 | 162 | }.bind(this); |
| 181 | 163 | }.bind(this); |
| @@ -241,7 +223,6 @@ | ||
| 241 | 223 | movebox(x, y) { |
| 242 | 224 | this.x = x; |
| 243 | 225 | this.y = y; |
| 244 | -// this.renderFunc.enqueue(this.rendermove.bind(this)); | |
| 245 | 226 | window.renderLoop.requestRenderFunc(this.rendermove.bind(this)); |
| 246 | 227 | |
| 247 | 228 | this.debuglog("movebox() x=" + this.x + ", y=" + this.y); |
| @@ -263,7 +244,6 @@ | ||
| 263 | 244 | this.y = rect.top; |
| 264 | 245 | this.width = rect.right - rect.left; |
| 265 | 246 | this.height = rect.bottom - rect.top; |
| 266 | -// this.renderFunc.enqueue(this.renderscalebox.bind(this)); | |
| 267 | 247 | window.renderLoop.requestRenderFunc(this.renderscalebox.bind(this)); |
| 268 | 248 | this.fontsize = fontscale; |
| 269 | 249 | } |
| @@ -279,7 +259,6 @@ | ||
| 279 | 259 | rollbox(degree) { |
| 280 | 260 | this.degree = degree; |
| 281 | 261 | this.DOMbase.dataset.degree = degree; |
| 282 | -// this.renderFunc.enqueue(this.renderrollbox.bind(this)); | |
| 283 | 262 | window.renderLoop.requestRenderFunc(this.renderrollbox.bind(this)); |
| 284 | 263 | } |
| 285 | 264 | renderrollbox() { |
| @@ -329,7 +308,6 @@ | ||
| 329 | 308 | moveX = this.x + moveX; |
| 330 | 309 | moveY = this.y + moveY; |
| 331 | 310 | |
| 332 | -// this.renderFunc.enqueue(this.renderMoveDragging.bind(this, moveX, moveY)); | |
| 333 | 311 | window.renderLoop.requestRenderFunc(this.renderMoveDragging.bind(this, moveX, moveY)); |
| 334 | 312 | } |
| 335 | 313 | renderMoveDragging(x, y) { |
| @@ -7,7 +7,6 @@ | ||
| 7 | 7 | class CDisplayField { |
| 8 | 8 | constructor(dom) { |
| 9 | 9 | this.DOMobject = dom; |
| 10 | -// this.renderFunc = new Queue(); | |
| 11 | 10 | this.mouseMoveFunc = null; |
| 12 | 11 | this.mouseUpFunc = null; |
| 13 | 12 | } |
| @@ -51,17 +50,7 @@ | ||
| 51 | 50 | } |
| 52 | 51 | |
| 53 | 52 | |
| 54 | - /* | |
| 55 | - // ブラウザ上への描画 ------------------------- | |
| 56 | - render() { | |
| 57 | - while (0 < this.renderFunc.size()) { | |
| 58 | - let renderFunction = this.renderFunc.dequeue(); | |
| 59 | - renderFunction(); | |
| 60 | - } | |
| 61 | - } | |
| 62 | - */ | |
| 63 | 53 | |
| 64 | - | |
| 65 | 54 | // Event handler ------------------- |
| 66 | 55 | // 表示要素の drag & drop禁止 |
| 67 | 56 | onDragStart(evt) { |
| @@ -46,15 +46,6 @@ | ||
| 46 | 46 | } |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | - /* ★ObjIDMgrは描画には関与しないように変更★ | |
| 50 | - // 管理Elementの描画関数呼び出し | |
| 51 | - // requestAnimationFrame loop内から呼び出される | |
| 52 | - renderAll() { | |
| 53 | - for (let i = 0; i < this.ObjIDLen; i++) { | |
| 54 | - this.ObjIDarray[i].render(); | |
| 55 | - } | |
| 56 | - } | |
| 57 | - */ | |
| 58 | 49 | |
| 59 | 50 | // 指定されたIDの実体(への参照)を返す |
| 60 | 51 | getIDtoDispObj(id) { |
| @@ -16,7 +16,6 @@ | ||
| 16 | 16 | this.DOM = [null, null, null, null]; // focus表示用 |
| 17 | 17 | this.domScaler = null; |
| 18 | 18 | this.domRoller = null; |
| 19 | -// this.renderFunc = new Queue(); | |
| 20 | 19 | } |
| 21 | 20 | |
| 22 | 21 | debuglog(str) { |
| @@ -24,20 +23,8 @@ | ||
| 24 | 23 | debuglog("【PartsFocus】 focused objid=" + focused + ", " + str); |
| 25 | 24 | } |
| 26 | 25 | |
| 27 | -/* | |
| 28 | - // ブラウザ上への描画 ------------------------- | |
| 29 | 26 | |
| 30 | - // domの淵を囲むように Focus lineを表示する | |
| 31 | - // requestAnimationFrameからの呼び出しを想定 | |
| 32 | - render() { | |
| 33 | - while (0 < this.renderFunc.size()) { | |
| 34 | - let renderFunction = this.renderFunc.dequeue(); | |
| 35 | - renderFunction(); | |
| 36 | - } | |
| 37 | - } | |
| 38 | -*/ | |
| 39 | 27 | |
| 40 | - | |
| 41 | 28 | // 表示関数----------------------------------- |
| 42 | 29 | // Focus作成 |
| 43 | 30 | create() { |
| @@ -46,7 +33,6 @@ | ||
| 46 | 33 | this.DOM[cnt].dataset.objid = this.num2str[cnt]; |
| 47 | 34 | this.DOM[cnt].classList.add('focusimage'); |
| 48 | 35 | this.DOM[cnt].classList.add(this.num2str[cnt]); |
| 49 | -// this.renderFunc.enqueue(this.renderCreateOneFocusbar.bind(this, this.DOM[cnt], null)); | |
| 50 | 36 | window.renderLoop.requestRenderFunc(this.renderCreateOneFocusbar.bind(this, this.DOM[cnt], null)); |
| 51 | 37 | } |
| 52 | 38 | // this.debuglog("create() renderFunc size=" + this.renderFunc.size()); |
| @@ -66,7 +52,6 @@ | ||
| 66 | 52 | this.domScaler.dataset.objid = 'scaler'; |
| 67 | 53 | this.domScaler.classList.add('scaler'); |
| 68 | 54 | this.domScaler.addEventListener('mousedown', this.onMouseDownScale.bind(this), false); |
| 69 | -// this.renderFunc.enqueue(this.renderScaler.bind(this, null)); | |
| 70 | 55 | window.renderLoop.requestRenderFunc(this.renderScaler.bind(this, null)); |
| 71 | 56 | } |
| 72 | 57 | renderScaler(rect) { |
| @@ -80,7 +65,6 @@ | ||
| 80 | 65 | this.domRoller.dataset.objid = 'roller'; |
| 81 | 66 | this.domRoller.classList.add('roller'); |
| 82 | 67 | this.domRoller.addEventListener('mousedown', this.onMouseDownRoll.bind(this), false); |
| 83 | -// this.renderFunc.enqueue(this.renderRoller.bind(this, null)); | |
| 84 | 68 | window.renderLoop.requestRenderFunc(this.renderRoller.bind(this, null)); |
| 85 | 69 | } |
| 86 | 70 | renderRoller(rect) { |
| @@ -105,7 +89,7 @@ | ||
| 105 | 89 | this.clingingPartner = null; |
| 106 | 90 | // requestAnimationFrameでの描画タイミング中は DOM.outerHTMLを変更できないため |
| 107 | 91 | // 処理ロジック上のまま削除処理を実行する |
| 108 | - // this.renderFunc.enqueue( this.renderClearClingingPartner.bind(this) ); | |
| 92 | + // window.renderLoop.requestRenderFunc( this.renderClearClingingPartner.bind(this) ); | |
| 109 | 93 | this.debuglog("clearClingingPartner()"); |
| 110 | 94 | |
| 111 | 95 | this.renderClearClingingPartner(); |
| @@ -199,7 +183,6 @@ | ||
| 199 | 183 | |
| 200 | 184 | switch(1){ |
| 201 | 185 | case 0: // 領域サイズ変更のみ |
| 202 | -// this.renderFunc.enqueue(this.renderMouseMoveScale.bind(this, this.scaleStartWidth + moveX, this.scaleStartHeight + moveY)); | |
| 203 | 186 | window.renderLoop.requestRenderFunc(this.renderMouseMoveScale.bind(this, this.scaleStartWidth + moveX, this.scaleStartHeight + moveY)); |
| 204 | 187 | break; |
| 205 | 188 | case 1: // 縦倍率に合わせfont sizeも変更 |
| @@ -206,7 +189,6 @@ | ||
| 206 | 189 | { |
| 207 | 190 | let orgheight = parseInt(eleFocus[1].dataset.orgheight); |
| 208 | 191 | let scaleY = (this.scaleStartHeight + moveY) / orgheight * 100; // ★さらに初期倍率設定値を掛ける必要がある |
| 209 | -// this.renderFunc.enqueue(this.renderMouseMoveScale.bind(this, this.scaleStartWidth + moveX, this.scaleStartHeight + moveY, scaleY)); | |
| 210 | 192 | window.renderLoop.requestRenderFunc(this.renderMouseMoveScale.bind(this, this.scaleStartWidth + moveX, this.scaleStartHeight + moveY, scaleY)); |
| 211 | 193 | } |
| 212 | 194 | break; |
| @@ -291,7 +273,6 @@ | ||
| 291 | 273 | let y2 = evt.pageY; |
| 292 | 274 | let degree = angle(x2, y2, x1, y1); |
| 293 | 275 | |
| 294 | -// this.renderFunc.enqueue(this.renderMouseMoveRoll.bind(this, degree)); | |
| 295 | 276 | window.renderLoop.requestRenderFunc(this.renderMouseMoveRoll.bind(this, degree)); |
| 296 | 277 | } |
| 297 | 278 | renderMouseMoveRoll(degree) { |
| @@ -10,7 +10,6 @@ | ||
| 10 | 10 | constructor() { |
| 11 | 11 | this.DOMobject = []; |
| 12 | 12 | this.draggingDOM = null; |
| 13 | -// this.renderFunc = new Queue(); | |
| 14 | 13 | } |
| 15 | 14 | |
| 16 | 15 | debuglog(str) { |
| @@ -146,17 +145,7 @@ | ||
| 146 | 145 | } |
| 147 | 146 | } |
| 148 | 147 | |
| 149 | - /* | |
| 150 | - // 描画関数 --------------------- | |
| 151 | 148 | |
| 152 | - render() { | |
| 153 | - while (0 < this.renderFunc.size()) { | |
| 154 | - let renderFunction = this.renderFunc.dequeue(); | |
| 155 | - renderFunction(); | |
| 156 | - } | |
| 157 | - } | |
| 158 | - */ | |
| 159 | - | |
| 160 | 149 | // Event handler ----------------------- |
| 161 | 150 | |
| 162 | 151 | // Drag&Drop event : Application外からのfileのやり取り |
| @@ -230,7 +219,6 @@ | ||
| 230 | 219 | moveX = this.startElementX + moveX; |
| 231 | 220 | moveY = this.startElementY + moveY; |
| 232 | 221 | |
| 233 | -// this.renderFunc.enqueue(this.renderMoveDragging.bind(this, moveX, moveY)); | |
| 234 | 222 | window.renderLoop.requestRenderFunc(this.renderMoveDragging.bind(this, moveX, moveY)); |
| 235 | 223 | //this.renderMoveDragging(moveX, moveY); |
| 236 | 224 | } |
| @@ -16,7 +16,6 @@ | ||
| 16 | 16 | this.typeAction = 2; |
| 17 | 17 | |
| 18 | 18 | this.DOMobject = []; // bg,text,action |
| 19 | -// this.renderFunc = new Queue(); | |
| 20 | 19 | } |
| 21 | 20 | debuglog(str) { |
| 22 | 21 | debuglog('【PalGroup】 ' + str); |
| @@ -44,18 +43,6 @@ | ||
| 44 | 43 | } |
| 45 | 44 | |
| 46 | 45 | |
| 47 | - /* | |
| 48 | - // 描画関数 --------------------- | |
| 49 | - | |
| 50 | - render() { | |
| 51 | - while (0 < this.renderFunc.size()) { | |
| 52 | - let renderFunction = this.renderFunc.dequeue(); | |
| 53 | - renderFunction(); | |
| 54 | - } | |
| 55 | - } | |
| 56 | - */ | |
| 57 | - | |
| 58 | - | |
| 59 | 46 | // Event handler ----------------------- |
| 60 | 47 | |
| 61 | 48 | onMouseDown(evt) { |
| @@ -88,7 +75,6 @@ | ||
| 88 | 75 | moveX = this.startElementX + moveX; |
| 89 | 76 | moveY = this.startElementY + moveY; |
| 90 | 77 | |
| 91 | -// this.renderFunc.enqueue(this.renderMoveDragging.bind(this, moveX, moveY)); | |
| 92 | 78 | window.renderLoop.requestRenderFunc(this.renderMoveDragging.bind(this, moveX, moveY)); |
| 93 | 79 | //this.renderMoveDragging(moveX, moveY); |
| 94 | 80 | } |
| @@ -27,7 +27,6 @@ | ||
| 27 | 27 | |
| 28 | 28 | // DOMをクリア |
| 29 | 29 | this.initDOMobj(); |
| 30 | -// this.renderFunc = new Queue(); | |
| 31 | 30 | |
| 32 | 31 | |
| 33 | 32 | this.dropinitsize = 100.0; // File dropで作成する Elementの長辺の長さ |
| @@ -74,20 +73,6 @@ | ||
| 74 | 73 | } |
| 75 | 74 | |
| 76 | 75 | |
| 77 | - | |
| 78 | - /* | |
| 79 | - // ブラウザ上への描画 ------------------------- | |
| 80 | - | |
| 81 | - // コマンド要求実行後の描画共通処理 | |
| 82 | - // requestAnimationFrameのcallbackから呼び出される | |
| 83 | - render() { | |
| 84 | - while (0 < this.renderFunc.size()) { | |
| 85 | - let renderFunction = this.renderFunc.dequeue(); | |
| 86 | - renderFunction(); | |
| 87 | - } | |
| 88 | - } | |
| 89 | - */ | |
| 90 | - | |
| 91 | 76 | // コマンド実行処理 ----------------------------- |
| 92 | 77 | |
| 93 | 78 | // DIV Box作成 |
| @@ -140,7 +125,6 @@ | ||
| 140 | 125 | } |
| 141 | 126 | else { |
| 142 | 127 | // 描画呼び出し時に呼び出す関数を登録 |
| 143 | -// this.renderFunc.enqueue(this.renderCreate.bind(this)); | |
| 144 | 128 | window.renderLoop.requestRenderFunc(this.renderCreate.bind(this)); |
| 145 | 129 | } |
| 146 | 130 | } |
| @@ -153,7 +137,6 @@ | ||
| 153 | 137 | reader.onload = function (evt) { |
| 154 | 138 | this.text = evt.target.result; |
| 155 | 139 | // 描画呼び出し時に呼び出す関数を登録 |
| 156 | -// this.renderFunc.enqueue(this.renderCreate.bind(this)); | |
| 157 | 140 | window.renderLoop.requestRenderFunc(this.renderCreate.bind(this)); |
| 158 | 141 | }.bind(this); |
| 159 | 142 | } |
| @@ -175,7 +158,6 @@ | ||
| 175 | 158 | this.DOMobject.dataset.orgwidth = this.originalWidth; // transform: scaleの基準サイズ |
| 176 | 159 | this.DOMobject.dataset.orgheight = this.originalHeight; // 画像original sizeなのでこちらで管理 |
| 177 | 160 | // 表示サイズ取得完了したので画面に表示 |
| 178 | -// this.renderFunc.enqueue(this.renderCreate.bind(this)); | |
| 179 | 161 | window.renderLoop.requestRenderFunc(this.renderCreate.bind(this)); |
| 180 | 162 | }.bind(this); |
| 181 | 163 | }.bind(this); |
| @@ -241,7 +223,6 @@ | ||
| 241 | 223 | movebox(x, y) { |
| 242 | 224 | this.x = x; |
| 243 | 225 | this.y = y; |
| 244 | -// this.renderFunc.enqueue(this.rendermove.bind(this)); | |
| 245 | 226 | window.renderLoop.requestRenderFunc(this.rendermove.bind(this)); |
| 246 | 227 | |
| 247 | 228 | this.debuglog("movebox() x=" + this.x + ", y=" + this.y); |
| @@ -263,7 +244,6 @@ | ||
| 263 | 244 | this.y = rect.top; |
| 264 | 245 | this.width = rect.right - rect.left; |
| 265 | 246 | this.height = rect.bottom - rect.top; |
| 266 | -// this.renderFunc.enqueue(this.renderscalebox.bind(this)); | |
| 267 | 247 | window.renderLoop.requestRenderFunc(this.renderscalebox.bind(this)); |
| 268 | 248 | this.fontsize = fontscale; |
| 269 | 249 | } |
| @@ -279,7 +259,6 @@ | ||
| 279 | 259 | rollbox(degree) { |
| 280 | 260 | this.degree = degree; |
| 281 | 261 | this.DOMbase.dataset.degree = degree; |
| 282 | -// this.renderFunc.enqueue(this.renderrollbox.bind(this)); | |
| 283 | 262 | window.renderLoop.requestRenderFunc(this.renderrollbox.bind(this)); |
| 284 | 263 | } |
| 285 | 264 | renderrollbox() { |
| @@ -329,7 +308,6 @@ | ||
| 329 | 308 | moveX = this.x + moveX; |
| 330 | 309 | moveY = this.y + moveY; |
| 331 | 310 | |
| 332 | -// this.renderFunc.enqueue(this.renderMoveDragging.bind(this, moveX, moveY)); | |
| 333 | 311 | window.renderLoop.requestRenderFunc(this.renderMoveDragging.bind(this, moveX, moveY)); |
| 334 | 312 | } |
| 335 | 313 | renderMoveDragging(x, y) { |
| @@ -7,7 +7,6 @@ | ||
| 7 | 7 | class CDisplayField { |
| 8 | 8 | constructor(dom) { |
| 9 | 9 | this.DOMobject = dom; |
| 10 | -// this.renderFunc = new Queue(); | |
| 11 | 10 | this.mouseMoveFunc = null; |
| 12 | 11 | this.mouseUpFunc = null; |
| 13 | 12 | } |
| @@ -51,17 +50,7 @@ | ||
| 51 | 50 | } |
| 52 | 51 | |
| 53 | 52 | |
| 54 | - /* | |
| 55 | - // ブラウザ上への描画 ------------------------- | |
| 56 | - render() { | |
| 57 | - while (0 < this.renderFunc.size()) { | |
| 58 | - let renderFunction = this.renderFunc.dequeue(); | |
| 59 | - renderFunction(); | |
| 60 | - } | |
| 61 | - } | |
| 62 | - */ | |
| 63 | 53 | |
| 64 | - | |
| 65 | 54 | // Event handler ------------------- |
| 66 | 55 | // 表示要素の drag & drop禁止 |
| 67 | 56 | onDragStart(evt) { |
| @@ -46,15 +46,6 @@ | ||
| 46 | 46 | } |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | - /* ★ObjIDMgrは描画には関与しないように変更★ | |
| 50 | - // 管理Elementの描画関数呼び出し | |
| 51 | - // requestAnimationFrame loop内から呼び出される | |
| 52 | - renderAll() { | |
| 53 | - for (let i = 0; i < this.ObjIDLen; i++) { | |
| 54 | - this.ObjIDarray[i].render(); | |
| 55 | - } | |
| 56 | - } | |
| 57 | - */ | |
| 58 | 49 | |
| 59 | 50 | // 指定されたIDの実体(への参照)を返す |
| 60 | 51 | getIDtoDispObj(id) { |
| @@ -16,7 +16,6 @@ | ||
| 16 | 16 | this.DOM = [null, null, null, null]; // focus表示用 |
| 17 | 17 | this.domScaler = null; |
| 18 | 18 | this.domRoller = null; |
| 19 | -// this.renderFunc = new Queue(); | |
| 20 | 19 | } |
| 21 | 20 | |
| 22 | 21 | debuglog(str) { |
| @@ -24,20 +23,8 @@ | ||
| 24 | 23 | debuglog("【PartsFocus】 focused objid=" + focused + ", " + str); |
| 25 | 24 | } |
| 26 | 25 | |
| 27 | -/* | |
| 28 | - // ブラウザ上への描画 ------------------------- | |
| 29 | 26 | |
| 30 | - // domの淵を囲むように Focus lineを表示する | |
| 31 | - // requestAnimationFrameからの呼び出しを想定 | |
| 32 | - render() { | |
| 33 | - while (0 < this.renderFunc.size()) { | |
| 34 | - let renderFunction = this.renderFunc.dequeue(); | |
| 35 | - renderFunction(); | |
| 36 | - } | |
| 37 | - } | |
| 38 | -*/ | |
| 39 | 27 | |
| 40 | - | |
| 41 | 28 | // 表示関数----------------------------------- |
| 42 | 29 | // Focus作成 |
| 43 | 30 | create() { |
| @@ -46,7 +33,6 @@ | ||
| 46 | 33 | this.DOM[cnt].dataset.objid = this.num2str[cnt]; |
| 47 | 34 | this.DOM[cnt].classList.add('focusimage'); |
| 48 | 35 | this.DOM[cnt].classList.add(this.num2str[cnt]); |
| 49 | -// this.renderFunc.enqueue(this.renderCreateOneFocusbar.bind(this, this.DOM[cnt], null)); | |
| 50 | 36 | window.renderLoop.requestRenderFunc(this.renderCreateOneFocusbar.bind(this, this.DOM[cnt], null)); |
| 51 | 37 | } |
| 52 | 38 | // this.debuglog("create() renderFunc size=" + this.renderFunc.size()); |
| @@ -66,7 +52,6 @@ | ||
| 66 | 52 | this.domScaler.dataset.objid = 'scaler'; |
| 67 | 53 | this.domScaler.classList.add('scaler'); |
| 68 | 54 | this.domScaler.addEventListener('mousedown', this.onMouseDownScale.bind(this), false); |
| 69 | -// this.renderFunc.enqueue(this.renderScaler.bind(this, null)); | |
| 70 | 55 | window.renderLoop.requestRenderFunc(this.renderScaler.bind(this, null)); |
| 71 | 56 | } |
| 72 | 57 | renderScaler(rect) { |
| @@ -80,7 +65,6 @@ | ||
| 80 | 65 | this.domRoller.dataset.objid = 'roller'; |
| 81 | 66 | this.domRoller.classList.add('roller'); |
| 82 | 67 | this.domRoller.addEventListener('mousedown', this.onMouseDownRoll.bind(this), false); |
| 83 | -// this.renderFunc.enqueue(this.renderRoller.bind(this, null)); | |
| 84 | 68 | window.renderLoop.requestRenderFunc(this.renderRoller.bind(this, null)); |
| 85 | 69 | } |
| 86 | 70 | renderRoller(rect) { |
| @@ -105,7 +89,7 @@ | ||
| 105 | 89 | this.clingingPartner = null; |
| 106 | 90 | // requestAnimationFrameでの描画タイミング中は DOM.outerHTMLを変更できないため |
| 107 | 91 | // 処理ロジック上のまま削除処理を実行する |
| 108 | - // this.renderFunc.enqueue( this.renderClearClingingPartner.bind(this) ); | |
| 92 | + // window.renderLoop.requestRenderFunc( this.renderClearClingingPartner.bind(this) ); | |
| 109 | 93 | this.debuglog("clearClingingPartner()"); |
| 110 | 94 | |
| 111 | 95 | this.renderClearClingingPartner(); |
| @@ -199,7 +183,6 @@ | ||
| 199 | 183 | |
| 200 | 184 | switch(1){ |
| 201 | 185 | case 0: // 領域サイズ変更のみ |
| 202 | -// this.renderFunc.enqueue(this.renderMouseMoveScale.bind(this, this.scaleStartWidth + moveX, this.scaleStartHeight + moveY)); | |
| 203 | 186 | window.renderLoop.requestRenderFunc(this.renderMouseMoveScale.bind(this, this.scaleStartWidth + moveX, this.scaleStartHeight + moveY)); |
| 204 | 187 | break; |
| 205 | 188 | case 1: // 縦倍率に合わせfont sizeも変更 |
| @@ -206,7 +189,6 @@ | ||
| 206 | 189 | { |
| 207 | 190 | let orgheight = parseInt(eleFocus[1].dataset.orgheight); |
| 208 | 191 | let scaleY = (this.scaleStartHeight + moveY) / orgheight * 100; // ★さらに初期倍率設定値を掛ける必要がある |
| 209 | -// this.renderFunc.enqueue(this.renderMouseMoveScale.bind(this, this.scaleStartWidth + moveX, this.scaleStartHeight + moveY, scaleY)); | |
| 210 | 192 | window.renderLoop.requestRenderFunc(this.renderMouseMoveScale.bind(this, this.scaleStartWidth + moveX, this.scaleStartHeight + moveY, scaleY)); |
| 211 | 193 | } |
| 212 | 194 | break; |
| @@ -291,7 +273,6 @@ | ||
| 291 | 273 | let y2 = evt.pageY; |
| 292 | 274 | let degree = angle(x2, y2, x1, y1); |
| 293 | 275 | |
| 294 | -// this.renderFunc.enqueue(this.renderMouseMoveRoll.bind(this, degree)); | |
| 295 | 276 | window.renderLoop.requestRenderFunc(this.renderMouseMoveRoll.bind(this, degree)); |
| 296 | 277 | } |
| 297 | 278 | renderMouseMoveRoll(degree) { |
| @@ -81,32 +81,8 @@ | ||
| 81 | 81 | // 描画ループ |
| 82 | 82 | window.renderLoop = new RenderLoop(); |
| 83 | 83 | |
| 84 | - /* | |
| 85 | - // 画像読み込み等は待たずに実行開始 | |
| 86 | - window.startTime = window.performance.now(); | |
| 87 | - window.frameLength = 6.0; | |
| 88 | - // 描画用無限ループ | |
| 89 | - (function renderLoop () { | |
| 90 | - let nowTime = window.performance.now(); | |
| 91 | -// let frame = Math.floor((nowTime - window.startTime) / (1000.0 / 60.0) % window.frameLength); | |
| 92 | 84 | |
| 93 | - // Canvas area描画 (div tag) | |
| 94 | -// window.displayField.render(); | |
| 95 | - // 各表示要素の描画 (div, img tag) | |
| 96 | - window.ObjIDMgr.renderAll(); | |
| 97 | 85 | |
| 98 | - // Focus枠, scale, rotate obj描画 | |
| 99 | - window.partsFocus.render(); | |
| 100 | - // palette描画 | |
| 101 | - window.CSSPalGroup.render(); | |
| 102 | - window.CSSPalette.render(); | |
| 103 | - | |
| 104 | - requestAnimationFrame( renderLoop ); | |
| 105 | - })(); | |
| 106 | - */ | |
| 107 | - | |
| 108 | - | |
| 109 | - | |
| 110 | 86 | // worker threadからの Message受信関数 |
| 111 | 87 | // UI threadで処理が必要な commandが送られてくる |
| 112 | 88 | function receiveWorkerMessage(evt) { |
| @@ -10,7 +10,6 @@ | ||
| 10 | 10 | constructor() { |
| 11 | 11 | this.DOMobject = []; |
| 12 | 12 | this.draggingDOM = null; |
| 13 | -// this.renderFunc = new Queue(); | |
| 14 | 13 | } |
| 15 | 14 | |
| 16 | 15 | debuglog(str) { |
| @@ -146,17 +145,7 @@ | ||
| 146 | 145 | } |
| 147 | 146 | } |
| 148 | 147 | |
| 149 | - /* | |
| 150 | - // 描画関数 --------------------- | |
| 151 | 148 | |
| 152 | - render() { | |
| 153 | - while (0 < this.renderFunc.size()) { | |
| 154 | - let renderFunction = this.renderFunc.dequeue(); | |
| 155 | - renderFunction(); | |
| 156 | - } | |
| 157 | - } | |
| 158 | - */ | |
| 159 | - | |
| 160 | 149 | // Event handler ----------------------- |
| 161 | 150 | |
| 162 | 151 | // Drag&Drop event : Application外からのfileのやり取り |
| @@ -230,7 +219,6 @@ | ||
| 230 | 219 | moveX = this.startElementX + moveX; |
| 231 | 220 | moveY = this.startElementY + moveY; |
| 232 | 221 | |
| 233 | -// this.renderFunc.enqueue(this.renderMoveDragging.bind(this, moveX, moveY)); | |
| 234 | 222 | window.renderLoop.requestRenderFunc(this.renderMoveDragging.bind(this, moveX, moveY)); |
| 235 | 223 | //this.renderMoveDragging(moveX, moveY); |
| 236 | 224 | } |
| @@ -16,7 +16,6 @@ | ||
| 16 | 16 | this.typeAction = 2; |
| 17 | 17 | |
| 18 | 18 | this.DOMobject = []; // bg,text,action |
| 19 | -// this.renderFunc = new Queue(); | |
| 20 | 19 | } |
| 21 | 20 | debuglog(str) { |
| 22 | 21 | debuglog('【PalGroup】 ' + str); |
| @@ -44,18 +43,6 @@ | ||
| 44 | 43 | } |
| 45 | 44 | |
| 46 | 45 | |
| 47 | - /* | |
| 48 | - // 描画関数 --------------------- | |
| 49 | - | |
| 50 | - render() { | |
| 51 | - while (0 < this.renderFunc.size()) { | |
| 52 | - let renderFunction = this.renderFunc.dequeue(); | |
| 53 | - renderFunction(); | |
| 54 | - } | |
| 55 | - } | |
| 56 | - */ | |
| 57 | - | |
| 58 | - | |
| 59 | 46 | // Event handler ----------------------- |
| 60 | 47 | |
| 61 | 48 | onMouseDown(evt) { |
| @@ -88,7 +75,6 @@ | ||
| 88 | 75 | moveX = this.startElementX + moveX; |
| 89 | 76 | moveY = this.startElementY + moveY; |
| 90 | 77 | |
| 91 | -// this.renderFunc.enqueue(this.renderMoveDragging.bind(this, moveX, moveY)); | |
| 92 | 78 | window.renderLoop.requestRenderFunc(this.renderMoveDragging.bind(this, moveX, moveY)); |
| 93 | 79 | //this.renderMoveDragging(moveX, moveY); |
| 94 | 80 | } |