1234567891011121314151617181920212223242526272829303132333435363738 |
- <template>
- <canvas id="pathCanvas" width="740" height="250" />
- </template>
- <script>
- import {SCanvasView, SPath} from "@persagy-web/draw/lib";
- class TestView222 extends SCanvasView {
- 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}]);
- // this.path.polygon([{x:0,y:0},{x:0,y:150},{x:700,y:150}]);
- // this.path.polygon([{x:200,y:200},{x:100,y:200},{x:100,y:100}]);
- }
- onDraw(painter) {
- console.log(this.path)
- painter.drawPath(this.path)
- }
- }
- export default {
- name: 'pathCanvas',
- data(){
- return{
- view: ''
- }
- },
- mounted() {
- new TestView222()
- }
- }
- </script>
- <style scoped>
- </style>
|