MCPcopy Create free account
hub / github.com/bwasti/mebm / pointerdown

Method pointerdown

script.js:1086–1104  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

1084 return ratio;
1085 }).bind(this);
1086 let pointerdown = function(e) {
1087 if (!this.selected_layer) {
1088 return;
1089 }
1090 if (!(this.selected_layer instanceof MoveableLayer)) {
1091 return;
1092 }
1093 e.preventDefault();
1094 let f = this.selected_layer.getFrame(this.time);
1095 if (!f) {
1096 return;
1097 }
1098 dragging = true;
1099 base_x = e.offsetX * get_ratio(e.target) - f[0];
1100 base_y = e.offsetY * get_ratio(e.target) - f[1];
1101 window.addEventListener('pointerup', pointerup, {
1102 once: true
1103 });
1104 }
1105 let pointermove = function(e) {
1106 if (this.gesturing) { return; }
1107 e.preventDefault();

Callers

nothing calls this directly

Calls 1

getFrameMethod · 0.80

Tested by

no test coverage detected