123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <template>
- <canvas id="pathCanvas" width="740" height="250"/>
- </template>
- <script lang="ts">
- import { SCanvasView, SPainter, SPath } from "@persagy-web/draw/lib";
- import { Component, Vue } from "vue-property-decorator";
- class TestView222 extends SCanvasView {
- path: SPath;
-
- constructor() {
- super('pathCanvas');
- this.path = new SPath();
-
- this.path.polygon([{x: 700, y: 150}, {x: 0, y: 150}, {x: 0, y: 0}]);
-
- this.path.polygon([{x: 100, y: 100}, {x: 100, y: 200}, {x: 200, y: 200}]);
-
-
- }
-
- onDraw(painter: SPainter) {
-
- painter.drawPath(this.path)
- }
- }
- @Component
- export default class PathCanvas extends Vue {
-
- mounted(): void {
- new TestView222();
- }
- }
- </script>
- <style scoped>
- </style>
|