소스 검색

Add CanvasSource.canvas

customisations
alemart 2 달 전
부모
커밋
14cf49d01d
2개의 변경된 파일19개의 추가작업 그리고 1개의 파일을 삭제
  1. 11
    1
      docs/api/canvas-source.md
  2. 8
    0
      src/sources/canvas-source.ts

+ 11
- 1
docs/api/canvas-source.md 파일 보기

@@ -16,4 +16,14 @@ Create a new source of data linked to the provided `canvas`.
16 16
 
17 17
 **Returns**
18 18
 
19
-A new source of data.
19
+A new source of data.
20
+
21
+## Properties
22
+
23
+### canvas
24
+
25
+`source.canvas: HTMLCanvasElement, read-only`
26
+
27
+The underlying `<canvas>` element.
28
+
29
+*Since:* 0.4.4

+ 8
- 0
src/sources/canvas-source.ts 파일 보기

@@ -52,6 +52,14 @@ export class CanvasSource implements Source
52 52
     }
53 53
 
54 54
     /**
55
+     * The underlying <canvas> element
56
+     */
57
+    get canvas(): HTMLCanvasElement
58
+    {
59
+        return this._canvas;
60
+    }
61
+
62
+    /**
55 63
      * A type-identifier of the source of data
56 64
      * @internal
57 65
      */

Loading…
취소
저장