fix ink demo
This commit is contained in:
parent
4e2ece8f01
commit
1f1cfcb597
|
|
@ -14,12 +14,14 @@
|
|||
position: relative;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
button {
|
||||
margin: 0.5rem;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<nav>
|
||||
<button on:click="DRAW">Draw</button>
|
||||
</nav>
|
||||
<button on:click="DRAW">Draw</button>
|
||||
<script type="module">
|
||||
import '../src/standalone/folk-shape.ts';
|
||||
import '../src/standalone/folk-ink.ts';
|
||||
|
|
|
|||
|
|
@ -146,11 +146,11 @@ export class FolkInk extends HTMLElement {
|
|||
|
||||
handleEvent(event: PointerEvent) {
|
||||
switch (event.type) {
|
||||
// for some reason adding a point on pointer down causes a bug
|
||||
case 'pointerdown': {
|
||||
if (event.button !== 0 || event.ctrlKey) return;
|
||||
|
||||
this.points = [];
|
||||
this.addPoint([event.offsetX, event.offsetY, event.pressure]);
|
||||
this.addEventListener('lostpointercapture', this);
|
||||
this.addEventListener('pointermove', this);
|
||||
this.setPointerCapture(event.pointerId);
|
||||
|
|
|
|||
Loading…
Reference in New Issue