"mouse" to "pointer" events

This commit is contained in:
Jörn-Michael Miehe 2023-01-17 14:09:13 +00:00
parent d16abe2658
commit 9fa1498af3

View file

@ -6,9 +6,9 @@
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 1000 1000" viewBox="0 0 1000 1000"
preserveAspectRatio="none" preserveAspectRatio="none"
@mousedown="on_mousedown" @pointerdown="on_pointerdown"
@mousemove="on_mousemove" @pointermove="on_pointermove"
@mouseup="on_mouseup" @pointerup="on_pointerup"
> >
<rect <rect
v-if="preview_state.visible" v-if="preview_state.visible"
@ -48,17 +48,17 @@ export default class CalendarImage extends Vue {
corner2: new Vector2D(), corner2: new Vector2D(),
}; };
private on_mousedown(event: MouseEvent) { private on_pointerdown(event: MouseEvent) {
this.preview_state.visible = true; this.preview_state.visible = true;
this.preview_state.corner1 = get_event_thous(event); this.preview_state.corner1 = get_event_thous(event);
this.preview_state.corner2 = get_event_thous(event); this.preview_state.corner2 = get_event_thous(event);
} }
private on_mousemove(event: MouseEvent) { private on_pointermove(event: MouseEvent) {
this.preview_state.corner2 = get_event_thous(event); this.preview_state.corner2 = get_event_thous(event);
} }
private on_mouseup() { private on_pointerup() {
this.preview_state.visible = false; this.preview_state.visible = false;
} }