tmp debug

Signed-off-by: dignow <linlong1265@gmail.com>
This commit is contained in:
dignow 2023-08-10 01:02:27 +08:00
parent 93a600a0a8
commit 9e0feb0b64
2 changed files with 20 additions and 21 deletions

View File

@ -585,8 +585,8 @@ class InputModel {
late final dynamic evtValue;
if (type == 'pan_update') {
evtValue = {
'x': '${x.toInt()}',
'y': '${y.toInt()}',
'x': x.toInt(),
'y': y.toInt(),
};
} else {
final isMoveTypes = ['pan_start', 'pan_end'];
@ -601,8 +601,8 @@ class InputModel {
return;
}
evtValue = {
'x': '${pos.x}',
'y': '${pos.y}',
'x': pos.x,
'y': pos.y,
};
}

View File

@ -1179,30 +1179,29 @@ pub fn session_send_pointer(session_id: SessionID, msg: String) {
let command = m.get("command").is_some();
match (m.get("k"), m.get("v")) {
(Some(k), Some(v)) => match k.as_str() {
Some("touch") => match v.as_str() {
Some("scale") => match v.get("v") {
Some("touch") => match v.get("t").and_then(|t| t.as_str()) {
Some("scale") => match v.get("v").and_then(|s| s.as_i64()) {
Some(scale) => {
if let Some(scale) = scale.as_i64() {
if let Some(session) = SESSIONS.read().unwrap().get(&session_id) {
session.send_touch_scale(scale as _, alt, ctrl, shift, command);
}
if let Some(session) = SESSIONS.read().unwrap().get(&session_id) {
session.send_touch_scale(scale as _, alt, ctrl, shift, command);
}
}
None => {}
},
Some(pan_event) => match (v.get("x"), v.get("y")) {
(Some(x), Some(y)) => {
if let Some(x) = x.as_i64() {
if let Some(y) = y.as_i64() {
if let Some(session) = SESSIONS.read().unwrap().get(&session_id)
{
session.send_touch_pan_event(
pan_event, x as _, y as _, alt, ctrl, shift, command,
);
}
Some(pan_event) => match v.get("v") {
Some(v) => match (
v.get("x").and_then(|x| x.as_i64()),
v.get("y").and_then(|y| y.as_i64()),
) {
(Some(x), Some(y)) => {
if let Some(session) = SESSIONS.read().unwrap().get(&session_id) {
session.send_touch_pan_event(
pan_event, x as _, y as _, alt, ctrl, shift, command,
);
}
}
}
_ => {}
},
_ => {}
},
_ => {}