From 8807d5ae5c7e98b4210fe568373ad505d341757e Mon Sep 17 00:00:00 2001 From: Yoshihiro Yamazaki Date: Sat, 8 Dec 2012 02:08:03 +0900 Subject: [PATCH] =?utf8?q?FlappDisplay=20=E3=81=AB=20places=20=E3=82=92?= =?utf8?q?=E6=8C=81=E3=81=9F=E3=81=AA=E3=81=84=E4=BA=8B=E3=81=AB=E3=81=99?= =?utf8?q?=E3=82=8B=20(obj=20=E3=81=AB=20matrix,=20transform,=20clipDepth?= =?utf8?q?=20=E3=82=92=E5=85=A5=E3=82=8C=E3=82=8B)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/display.js | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/src/display.js b/src/display.js index d1a8239..18fd3dd 100644 --- a/src/display.js +++ b/src/display.js @@ -7,31 +7,35 @@ goog.scope(function () { */ FlappDisplay = function() { this.objs = {}; - this.places = {}; }; FlappDisplay.prototype = { set: function(depth, obj, place) { - if (obj) { - this.objs[depth] = obj; - if (place.matrix) { - obj.matrix = place.matrix; - } - if (place.colorTransform) { - obj.colorTransform = place.colorTransform; - } + this.objs[depth] = obj; + obj.matrix = place.matrix; + obj.colorTransform = place.colorTransform; + obj.clipDepth = place.clipDepth; + console.log('this.objs'); + console.log(this.objs); + }, + move: function(depth, place) + { + var obj = this.objs[depth]; + if (place.matrix) { + obj.matrix = place.matrix; + } + if (place.colorTransform) { + obj.colorTransform = place.colorTransform; } - this.places[depth] = place; }, - getObj: function(depth) { + get: function(depth) { + console.log(this.objs); + console.debug("get: depth:"+depth); return this.objs[depth]; }, - getPlace: function(depth) { - return this.places[depth]; - }, del: function(depth) { + this.objs[depth].destroy(); delete this.objs[depth]; - delete this.places[depth]; }, descSortedDepth: function() { var keys = Object.keys(this.objs); -- 2.11.0