mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Broadcast mouse activity (#1175)
* broadcast mouse activity * move to same MOUSE_LOCATION event * remove key up handler * update tests * Fix border * refactor * rename activity to button Co-authored-by: Panayiotis Lipiridis <lipiridis@gmail.com>
This commit is contained in:
parent
23540eba4c
commit
b97520400a
7 changed files with 116 additions and 14 deletions
|
@ -10,6 +10,7 @@ Object {
|
|||
"currentItemRoughness": 1,
|
||||
"currentItemStrokeColor": "#000000",
|
||||
"currentItemStrokeWidth": 1,
|
||||
"cursorButton": "up",
|
||||
"cursorX": 0,
|
||||
"cursorY": 0,
|
||||
"draggingElement": null,
|
||||
|
@ -197,6 +198,7 @@ Object {
|
|||
"currentItemRoughness": 1,
|
||||
"currentItemStrokeColor": "#000000",
|
||||
"currentItemStrokeWidth": 1,
|
||||
"cursorButton": "up",
|
||||
"cursorX": 0,
|
||||
"cursorY": 0,
|
||||
"draggingElement": null,
|
||||
|
@ -307,6 +309,7 @@ Object {
|
|||
"currentItemRoughness": 1,
|
||||
"currentItemStrokeColor": "#5f3dc4",
|
||||
"currentItemStrokeWidth": 1,
|
||||
"cursorButton": "up",
|
||||
"cursorX": 0,
|
||||
"cursorY": 0,
|
||||
"draggingElement": null,
|
||||
|
@ -557,6 +560,7 @@ Object {
|
|||
"currentItemRoughness": 1,
|
||||
"currentItemStrokeColor": "#000000",
|
||||
"currentItemStrokeWidth": 1,
|
||||
"cursorButton": "up",
|
||||
"cursorX": 0,
|
||||
"cursorY": 0,
|
||||
"draggingElement": null,
|
||||
|
@ -703,6 +707,7 @@ Object {
|
|||
"currentItemRoughness": 1,
|
||||
"currentItemStrokeColor": "#000000",
|
||||
"currentItemStrokeWidth": 1,
|
||||
"cursorButton": "up",
|
||||
"cursorX": 0,
|
||||
"cursorY": 0,
|
||||
"draggingElement": null,
|
||||
|
@ -885,6 +890,7 @@ Object {
|
|||
"currentItemRoughness": 1,
|
||||
"currentItemStrokeColor": "#000000",
|
||||
"currentItemStrokeWidth": 1,
|
||||
"cursorButton": "up",
|
||||
"cursorX": 0,
|
||||
"cursorY": 0,
|
||||
"draggingElement": null,
|
||||
|
@ -1072,6 +1078,7 @@ Object {
|
|||
"currentItemRoughness": 1,
|
||||
"currentItemStrokeColor": "#000000",
|
||||
"currentItemStrokeWidth": 1,
|
||||
"cursorButton": "up",
|
||||
"cursorX": 0,
|
||||
"cursorY": 0,
|
||||
"draggingElement": null,
|
||||
|
@ -1355,6 +1362,7 @@ Object {
|
|||
"currentItemRoughness": 1,
|
||||
"currentItemStrokeColor": "#000000",
|
||||
"currentItemStrokeWidth": 1,
|
||||
"cursorButton": "up",
|
||||
"cursorX": 0,
|
||||
"cursorY": 0,
|
||||
"draggingElement": null,
|
||||
|
@ -1951,6 +1959,7 @@ Object {
|
|||
"currentItemRoughness": 1,
|
||||
"currentItemStrokeColor": "#000000",
|
||||
"currentItemStrokeWidth": 1,
|
||||
"cursorButton": "up",
|
||||
"cursorX": 0,
|
||||
"cursorY": 0,
|
||||
"draggingElement": null,
|
||||
|
@ -2061,6 +2070,7 @@ Object {
|
|||
"currentItemRoughness": 1,
|
||||
"currentItemStrokeColor": "#000000",
|
||||
"currentItemStrokeWidth": 1,
|
||||
"cursorButton": "up",
|
||||
"cursorX": 0,
|
||||
"cursorY": 0,
|
||||
"draggingElement": null,
|
||||
|
@ -2171,6 +2181,7 @@ Object {
|
|||
"currentItemRoughness": 1,
|
||||
"currentItemStrokeColor": "#000000",
|
||||
"currentItemStrokeWidth": 1,
|
||||
"cursorButton": "up",
|
||||
"cursorX": 0,
|
||||
"cursorY": 0,
|
||||
"draggingElement": null,
|
||||
|
@ -2281,6 +2292,7 @@ Object {
|
|||
"currentItemRoughness": 1,
|
||||
"currentItemStrokeColor": "#000000",
|
||||
"currentItemStrokeWidth": 1,
|
||||
"cursorButton": "up",
|
||||
"cursorX": 0,
|
||||
"cursorY": 0,
|
||||
"draggingElement": null,
|
||||
|
@ -2413,6 +2425,7 @@ Object {
|
|||
"currentItemRoughness": 1,
|
||||
"currentItemStrokeColor": "#000000",
|
||||
"currentItemStrokeWidth": 1,
|
||||
"cursorButton": "up",
|
||||
"cursorX": 0,
|
||||
"cursorY": 0,
|
||||
"draggingElement": null,
|
||||
|
@ -2545,6 +2558,7 @@ Object {
|
|||
"currentItemRoughness": 1,
|
||||
"currentItemStrokeColor": "#000000",
|
||||
"currentItemStrokeWidth": 1,
|
||||
"cursorButton": "up",
|
||||
"cursorX": 0,
|
||||
"cursorY": 0,
|
||||
"draggingElement": null,
|
||||
|
@ -2677,6 +2691,7 @@ Object {
|
|||
"currentItemRoughness": 1,
|
||||
"currentItemStrokeColor": "#000000",
|
||||
"currentItemStrokeWidth": 1,
|
||||
"cursorButton": "up",
|
||||
"cursorX": 0,
|
||||
"cursorY": 0,
|
||||
"draggingElement": null,
|
||||
|
@ -2787,6 +2802,7 @@ Object {
|
|||
"currentItemRoughness": 1,
|
||||
"currentItemStrokeColor": "#000000",
|
||||
"currentItemStrokeWidth": 1,
|
||||
"cursorButton": "up",
|
||||
"cursorX": 0,
|
||||
"cursorY": 0,
|
||||
"draggingElement": null,
|
||||
|
@ -2897,6 +2913,7 @@ Object {
|
|||
"currentItemRoughness": 1,
|
||||
"currentItemStrokeColor": "#000000",
|
||||
"currentItemStrokeWidth": 1,
|
||||
"cursorButton": "up",
|
||||
"cursorX": 0,
|
||||
"cursorY": 0,
|
||||
"draggingElement": null,
|
||||
|
@ -3029,6 +3046,7 @@ Object {
|
|||
"currentItemRoughness": 1,
|
||||
"currentItemStrokeColor": "#000000",
|
||||
"currentItemStrokeWidth": 1,
|
||||
"cursorButton": "up",
|
||||
"cursorX": 0,
|
||||
"cursorY": 0,
|
||||
"draggingElement": null,
|
||||
|
@ -3139,6 +3157,7 @@ Object {
|
|||
"currentItemRoughness": 1,
|
||||
"currentItemStrokeColor": "#000000",
|
||||
"currentItemStrokeWidth": 1,
|
||||
"cursorButton": "down",
|
||||
"cursorX": 0,
|
||||
"cursorY": 0,
|
||||
"draggingElement": null,
|
||||
|
@ -3191,6 +3210,7 @@ Object {
|
|||
"currentItemRoughness": 1,
|
||||
"currentItemStrokeColor": "#000000",
|
||||
"currentItemStrokeWidth": 1,
|
||||
"cursorButton": "up",
|
||||
"cursorX": 0,
|
||||
"cursorY": 0,
|
||||
"draggingElement": null,
|
||||
|
@ -3877,6 +3897,7 @@ Object {
|
|||
"currentItemRoughness": 1,
|
||||
"currentItemStrokeColor": "#000000",
|
||||
"currentItemStrokeWidth": 1,
|
||||
"cursorButton": "up",
|
||||
"cursorX": 0,
|
||||
"cursorY": 0,
|
||||
"draggingElement": null,
|
||||
|
@ -4239,6 +4260,7 @@ Object {
|
|||
"currentItemRoughness": 1,
|
||||
"currentItemStrokeColor": "#000000",
|
||||
"currentItemStrokeWidth": 1,
|
||||
"cursorButton": "up",
|
||||
"cursorX": 0,
|
||||
"cursorY": 0,
|
||||
"draggingElement": null,
|
||||
|
@ -4529,6 +4551,7 @@ Object {
|
|||
"currentItemRoughness": 1,
|
||||
"currentItemStrokeColor": "#000000",
|
||||
"currentItemStrokeWidth": 1,
|
||||
"cursorButton": "up",
|
||||
"cursorX": 0,
|
||||
"cursorY": 0,
|
||||
"draggingElement": null,
|
||||
|
@ -4747,6 +4770,7 @@ Object {
|
|||
"currentItemRoughness": 1,
|
||||
"currentItemStrokeColor": "#000000",
|
||||
"currentItemStrokeWidth": 1,
|
||||
"cursorButton": "up",
|
||||
"cursorX": 0,
|
||||
"cursorY": 0,
|
||||
"draggingElement": null,
|
||||
|
@ -4893,6 +4917,7 @@ Object {
|
|||
"currentItemRoughness": 1,
|
||||
"currentItemStrokeColor": "#000000",
|
||||
"currentItemStrokeWidth": 1,
|
||||
"cursorButton": "up",
|
||||
"cursorX": 0,
|
||||
"cursorY": 0,
|
||||
"draggingElement": null,
|
||||
|
@ -5543,6 +5568,7 @@ Object {
|
|||
"currentItemRoughness": 1,
|
||||
"currentItemStrokeColor": "#000000",
|
||||
"currentItemStrokeWidth": 1,
|
||||
"cursorButton": "up",
|
||||
"cursorX": 0,
|
||||
"cursorY": 0,
|
||||
"draggingElement": null,
|
||||
|
@ -6121,6 +6147,7 @@ Object {
|
|||
"currentItemRoughness": 1,
|
||||
"currentItemStrokeColor": "#000000",
|
||||
"currentItemStrokeWidth": 1,
|
||||
"cursorButton": "up",
|
||||
"cursorX": 0,
|
||||
"cursorY": 0,
|
||||
"draggingElement": null,
|
||||
|
@ -6627,6 +6654,7 @@ Object {
|
|||
"currentItemRoughness": 1,
|
||||
"currentItemStrokeColor": "#000000",
|
||||
"currentItemStrokeWidth": 1,
|
||||
"cursorButton": "up",
|
||||
"cursorX": 0,
|
||||
"cursorY": 0,
|
||||
"draggingElement": null,
|
||||
|
@ -7061,6 +7089,7 @@ Object {
|
|||
"currentItemRoughness": 1,
|
||||
"currentItemStrokeColor": "#000000",
|
||||
"currentItemStrokeWidth": 1,
|
||||
"cursorButton": "up",
|
||||
"cursorX": 0,
|
||||
"cursorY": 0,
|
||||
"draggingElement": null,
|
||||
|
@ -7459,6 +7488,7 @@ Object {
|
|||
"currentItemRoughness": 1,
|
||||
"currentItemStrokeColor": "#000000",
|
||||
"currentItemStrokeWidth": 1,
|
||||
"cursorButton": "up",
|
||||
"cursorX": 0,
|
||||
"cursorY": 0,
|
||||
"draggingElement": null,
|
||||
|
@ -7785,6 +7815,7 @@ Object {
|
|||
"currentItemRoughness": 1,
|
||||
"currentItemStrokeColor": "#000000",
|
||||
"currentItemStrokeWidth": 1,
|
||||
"cursorButton": "up",
|
||||
"cursorX": 0,
|
||||
"cursorY": 0,
|
||||
"draggingElement": null,
|
||||
|
@ -8039,6 +8070,7 @@ Object {
|
|||
"currentItemRoughness": 1,
|
||||
"currentItemStrokeColor": "#000000",
|
||||
"currentItemStrokeWidth": 1,
|
||||
"cursorButton": "up",
|
||||
"cursorX": 0,
|
||||
"cursorY": 0,
|
||||
"draggingElement": null,
|
||||
|
@ -8221,6 +8253,7 @@ Object {
|
|||
"currentItemRoughness": 1,
|
||||
"currentItemStrokeColor": "#000000",
|
||||
"currentItemStrokeWidth": 1,
|
||||
"cursorButton": "up",
|
||||
"cursorX": 0,
|
||||
"cursorY": 0,
|
||||
"draggingElement": null,
|
||||
|
@ -8907,6 +8940,7 @@ Object {
|
|||
"currentItemRoughness": 1,
|
||||
"currentItemStrokeColor": "#000000",
|
||||
"currentItemStrokeWidth": 1,
|
||||
"cursorButton": "up",
|
||||
"cursorX": 0,
|
||||
"cursorY": 0,
|
||||
"draggingElement": null,
|
||||
|
@ -9521,6 +9555,7 @@ Object {
|
|||
"currentItemRoughness": 1,
|
||||
"currentItemStrokeColor": "#000000",
|
||||
"currentItemStrokeWidth": 1,
|
||||
"cursorButton": "up",
|
||||
"cursorX": 0,
|
||||
"cursorY": 0,
|
||||
"draggingElement": null,
|
||||
|
@ -10063,6 +10098,7 @@ Object {
|
|||
"currentItemRoughness": 1,
|
||||
"currentItemStrokeColor": "#000000",
|
||||
"currentItemStrokeWidth": 1,
|
||||
"cursorButton": "up",
|
||||
"cursorX": 0,
|
||||
"cursorY": 0,
|
||||
"draggingElement": null,
|
||||
|
@ -10533,6 +10569,7 @@ Object {
|
|||
"currentItemRoughness": 1,
|
||||
"currentItemStrokeColor": "#000000",
|
||||
"currentItemStrokeWidth": 1,
|
||||
"cursorButton": "up",
|
||||
"cursorX": 0,
|
||||
"cursorY": 0,
|
||||
"draggingElement": null,
|
||||
|
@ -10777,6 +10814,7 @@ Object {
|
|||
"currentItemRoughness": 1,
|
||||
"currentItemStrokeColor": "#000000",
|
||||
"currentItemStrokeWidth": 1,
|
||||
"cursorButton": "up",
|
||||
"cursorX": 0,
|
||||
"cursorY": 0,
|
||||
"draggingElement": null,
|
||||
|
@ -10815,7 +10853,7 @@ Object {
|
|||
|
||||
exports[`regression tests spacebar + drag scrolls the canvas: [end of test] number of elements 1`] = `0`;
|
||||
|
||||
exports[`regression tests spacebar + drag scrolls the canvas: [end of test] number of renders 1`] = `4`;
|
||||
exports[`regression tests spacebar + drag scrolls the canvas: [end of test] number of renders 1`] = `5`;
|
||||
|
||||
exports[`regression tests two-finger scroll works: [end of test] appState 1`] = `
|
||||
Object {
|
||||
|
@ -10827,6 +10865,7 @@ Object {
|
|||
"currentItemRoughness": 1,
|
||||
"currentItemStrokeColor": "#000000",
|
||||
"currentItemStrokeWidth": 1,
|
||||
"cursorButton": "down",
|
||||
"cursorX": 0,
|
||||
"cursorY": 0,
|
||||
"draggingElement": null,
|
||||
|
@ -10879,6 +10918,7 @@ Object {
|
|||
"currentItemRoughness": 1,
|
||||
"currentItemStrokeColor": "#000000",
|
||||
"currentItemStrokeWidth": 1,
|
||||
"cursorButton": "up",
|
||||
"cursorX": 0,
|
||||
"cursorY": 0,
|
||||
"draggingElement": null,
|
||||
|
@ -11161,6 +11201,7 @@ Object {
|
|||
"currentItemRoughness": 1,
|
||||
"currentItemStrokeColor": "#000000",
|
||||
"currentItemStrokeWidth": 1,
|
||||
"cursorButton": "up",
|
||||
"cursorX": 0,
|
||||
"cursorY": 0,
|
||||
"draggingElement": null,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue