When deleting via put()/putDirty(), don't update bounds or write.
catseye
12 years ago
40 | 40 | * location will return this Playfield's default value. |
41 | 41 | */ |
42 | 42 | this.put = function(x, y, value) { |
43 | var key = x+','+y; | |
44 | if (value === undefined || value === this._default) { | |
45 | delete this._store[key]; | |
46 | return; | |
47 | } | |
43 | 48 | if (this.minX === undefined || x < this.minX) this.minX = x; |
44 | 49 | if (this.maxX === undefined || x > this.maxX) this.maxX = x; |
45 | 50 | if (this.minY === undefined || y < this.minY) this.minY = y; |
46 | 51 | if (this.maxY === undefined || y > this.maxY) this.maxY = y; |
47 | var key = x+','+y; | |
48 | if (value === undefined || value === this._default) { | |
49 | delete this._store[key]; | |
50 | } | |
51 | 52 | this._store[key] = value; |
52 | 53 | }; |
53 | 54 | |
60 | 61 | var key = x+','+y; |
61 | 62 | if (value === undefined || value === this._default) { |
62 | 63 | delete this._store[key]; |
64 | return; | |
63 | 65 | } |
64 | 66 | this._store[key] = value; |
65 | 67 | }; |