MCPcopy
hub / github.com/jabbany/CommentCoreLibrary / setBounds

Method setBounds

src/core/CommentManager.ts:130–143  ·  view source on GitHub ↗

* Set the bounds for the comment manager * @param width - width value px * @param height - height value px

(width:number = this.stage.offsetWidth, height:number = this.stage.offsetHeight)

Source from the content-addressed store, hash-verified

128 * @param height - height value px
129 */
130 public setBounds(width:number = this.stage.offsetWidth, height:number = this.stage.offsetHeight):void {
131 this._width = width;
132 this._height = height;
133 this.dispatchEvent("resize");
134 for(var allocator in this._csa){
135 if(this._csa.hasOwnProperty(allocator)){
136 var csa:CommentSpaceAllocator = this._csa[allocator];
137 csa.setBounds(this._width, this._height);
138 }
139 }
140 this.stage.style.perspective = this.width * Math.tan(40 * Math.PI/180) / 2 + "px";
141 // TODO: Remove webkit prefix
142 this.stage.style["webkitPerspective"] = this.width * Math.tan(40 * Math.PI/180) / 2 + "px";
143 }
144
145 /**
146 * Dispatches an event

Callers

nothing calls this directly

Calls 3

dispatchEventMethod · 0.95
hasOwnPropertyMethod · 0.80
setBoundsMethod · 0.65

Tested by

no test coverage detected