|
|
|
|
@ -6,8 +6,7 @@ function init_listeners(state, context) {
@@ -6,8 +6,7 @@ function init_listeners(state, context) {
|
|
|
|
|
context.canvas.addEventListener('pointerdown', (e) => pointerdown(e, state, context)); |
|
|
|
|
context.canvas.addEventListener('pointermove', (e) => pointermove(e, state, context)); |
|
|
|
|
context.canvas.addEventListener('pointerup', (e) => pointerup(e, state, context)); |
|
|
|
|
context.canvas.addEventListener('pointercancel', (e) => pointerup(e, state, context)); |
|
|
|
|
//context.canvas.addEventListener('pointerleave', (e) => pointerup(e, state, context));
|
|
|
|
|
context.canvas.addEventListener('pointercancel', (e) => pointercancel(e, state, context)); |
|
|
|
|
context.canvas.addEventListener('pointerleave', (e) => pointerleave(e, state, context)); |
|
|
|
|
context.canvas.addEventListener('contextmenu', cancel); |
|
|
|
|
context.canvas.addEventListener('wheel', (e) => wheel(e, state, context)); |
|
|
|
|
@ -170,7 +169,7 @@ function keydown(e, state, context) {
@@ -170,7 +169,7 @@ function keydown(e, state, context) {
|
|
|
|
|
|
|
|
|
|
function keyup(e, state, context) { |
|
|
|
|
if (config.debug_print) { |
|
|
|
|
console.debug('keydown', e.code); |
|
|
|
|
console.debug('keyup', e.code); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (e.code === 'Space' && state.spacedown) { |
|
|
|
|
@ -361,7 +360,11 @@ function pointermove(e, state, context) {
@@ -361,7 +360,11 @@ function pointermove(e, state, context) {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (state.colorpicking) { |
|
|
|
|
update_color_picker_color(state, context, canvasp); |
|
|
|
|
if (!e.ctrlKey) { |
|
|
|
|
exit_picker_mode(state); |
|
|
|
|
} else { |
|
|
|
|
update_color_picker_color(state, context, canvasp); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (state.zooming) { |
|
|
|
|
@ -590,8 +593,11 @@ function pointerleave(e, state, context) {
@@ -590,8 +593,11 @@ function pointerleave(e, state, context) {
|
|
|
|
|
context.canvas.classList.remove('movemode'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//exit_picker_mode(state);
|
|
|
|
|
// something else?
|
|
|
|
|
// exit_picker_mode(state);
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function pointercancel(e, state, context) { |
|
|
|
|
console.log('CANCEL'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function update_cursor(state) { |
|
|
|
|
|