Skip to content

Commit a6cf95e

Browse files
committed
More documentation
1 parent e6fab96 commit a6cf95e

File tree

4 files changed

+212
-16
lines changed

4 files changed

+212
-16
lines changed

src/Canvas2d/babylon.canvas2d.ts

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,10 @@
192192
this.scene.onPrePointerObservable.add((e, s) => this._handlePointerEventForInteraction(e, s));
193193
}
194194

195-
public setPointerCapture(pointerId: number, primitive: Prim2DBase): boolean {
195+
/**
196+
* Internal method, you should use the Prim2DBase version instead
197+
*/
198+
public _setPointerCapture(pointerId: number, primitive: Prim2DBase): boolean {
196199
if (this.isPointerCaptured(pointerId)) {
197200
return false;
198201
}
@@ -211,7 +214,10 @@
211214
return true;
212215
}
213216

214-
public releasePointerCapture(pointerId: number, primitive: Prim2DBase): boolean {
217+
/**
218+
* Internal method, you should use the Prim2DBase version instead
219+
*/
220+
public _releasePointerCapture(pointerId: number, primitive: Prim2DBase): boolean {
215221
if (this._capturedPointers.get(pointerId.toString()) !== primitive) {
216222
return false;
217223
}
@@ -229,7 +235,12 @@
229235
return true;
230236
}
231237

232-
public isPointerCaptured(pointerId: number) {
238+
/**
239+
* Determine if the given pointer is captured or not
240+
* @param pointerId the Id of the pointer
241+
* @return true if it's captured, false otherwise
242+
*/
243+
public isPointerCaptured(pointerId: number): boolean {
233244
return this._capturedPointers.contains(pointerId.toString());
234245
}
235246

@@ -388,7 +399,7 @@
388399
}
389400
}
390401

391-
private _notifDebugMode = true;
402+
private _notifDebugMode = false;
392403
private _debugExecObserver(prim: Prim2DBase, mask: number) {
393404
if (!this._notifDebugMode) {
394405
return;
@@ -616,6 +627,10 @@
616627
this._background.levelVisible = true;
617628
}
618629

630+
/**
631+
* Enable/Disable interaction for this Canvas
632+
* When enabled the Prim2DBase.pointerEventObservable property will notified when appropriate events occur
633+
*/
619634
public get interactionEnabled(): boolean {
620635
return this._interactionEnabled;
621636
}

src/Canvas2d/babylon.group2d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@
272272

273273
// We need to check if prepare is needed because even if the primitive is in the dirtyList, its parent primitive may also have been modified, then prepared, then recurse on its children primitives (this one for instance) if the changes where impacting them.
274274
// For instance: a Rect's position change, the position of its children primitives will also change so a prepare will be call on them. If a child was in the dirtyList we will avoid a second prepare by making this check.
275-
if (!p.isDisposed && p.needPrepare()) {
275+
if (!p.isDisposed && p._needPrepare()) {
276276
p._prepareRender(context);
277277
}
278278
});

0 commit comments

Comments
 (0)