正在显示
1 个修改的文件
包含
16 行增加
和
8 行删除
| @@ -369,11 +369,12 @@ | @@ -369,11 +369,12 @@ | ||
| 369 | 369 | ||
| 370 | var last_ext_press = 0; | 370 | var last_ext_press = 0; |
| 371 | function draw_ext_input(px,py,press) { | 371 | function draw_ext_input(px,py,press) { |
| 372 | + //x = canvas_width - px * ratio_x; | ||
| 373 | + //y = canvas_height - py * ratio_y; | ||
| 374 | + | ||
| 372 | x = px * ratio_x; | 375 | x = px * ratio_x; |
| 373 | y = py * ratio_y; | 376 | y = py * ratio_y; |
| 374 | 377 | ||
| 375 | - //y = canvas_height - py * ratio_y; | ||
| 376 | - | ||
| 377 | if(last_ext_press == 0 && press == 1){ | 378 | if(last_ext_press == 0 && press == 1){ |
| 378 | ctx.beginPath(); | 379 | ctx.beginPath(); |
| 379 | 380 | ||
| @@ -832,6 +833,10 @@ | @@ -832,6 +833,10 @@ | ||
| 832 | ext_input_connecting = !ext_input_connecting; | 833 | ext_input_connecting = !ext_input_connecting; |
| 833 | } | 834 | } |
| 834 | 835 | ||
| 836 | + function rotateExtInput() { | ||
| 837 | + doCmd("rotate_ext_input"); | ||
| 838 | + } | ||
| 839 | + | ||
| 835 | function doCmd(cmdName) { | 840 | function doCmd(cmdName) { |
| 836 | writeToScreen(cmdName); | 841 | writeToScreen(cmdName); |
| 837 | var cmd = new Object(); | 842 | var cmd = new Object(); |
| @@ -1076,6 +1081,14 @@ | @@ -1076,6 +1081,14 @@ | ||
| 1076 | Uint32param[0] = 1; | 1081 | Uint32param[0] = 1; |
| 1077 | cmd.data = new Uint8Array(buffer, 0, cmd.data_len); | 1082 | cmd.data = new Uint8Array(buffer, 0, cmd.data_len); |
| 1078 | } | 1083 | } |
| 1084 | + else if(cmdName == "rotate_ext_input") { | ||
| 1085 | + cmd.type = 57; | ||
| 1086 | + cmd.data_len = 4; | ||
| 1087 | + var buffer = new ArrayBuffer(cmd.data_len); | ||
| 1088 | + var Uint32param = new Uint32Array(buffer, 0, 1); | ||
| 1089 | + Uint32param[0] = 2; | ||
| 1090 | + cmd.data = new Uint8Array(buffer, 0, cmd.data_len); | ||
| 1091 | + } | ||
| 1079 | 1092 | ||
| 1080 | doSendWSCmd(cmd); | 1093 | doSendWSCmd(cmd); |
| 1081 | } | 1094 | } |
| @@ -1570,15 +1583,10 @@ | @@ -1570,15 +1583,10 @@ | ||
| 1570 | </table> | 1583 | </table> |
| 1571 | </div> | 1584 | </div> |
| 1572 | <div> | 1585 | <div> |
| 1573 | - <div> | ||
| 1574 | - <button type="button" id="mouse" onclick="javascript:onMouseClick(this);">mouse</button> | ||
| 1575 | - <button type="button" id="connect" onclick="javascript:onConnectClick(this);">connect</button> | ||
| 1576 | - <button type="button" id="rotate" onclick="javascript:onRotateClick(this);">rotate</button> | ||
| 1577 | - <button type="button" id="clear" onclick="javascript:onClearClick(this);">clear</button> | ||
| 1578 | - </div> | ||
| 1579 | <div id="page"> | 1586 | <div id="page"> |
| 1580 | <div class="header"> | 1587 | <div class="header"> |
| 1581 | <a id="new" class="navbtn" onclick="newCanvas()">New</a> | 1588 | <a id="new" class="navbtn" onclick="newCanvas()">New</a> |
| 1589 | + <a id="rotate_ext_input" class="navbtn" onclick="rotateExtInput()">Rotate</a> | ||
| 1582 | <div class="title">Sketch Pad</div> | 1590 | <div class="title">Sketch Pad</div> |
| 1583 | </div> | 1591 | </div> |
| 1584 | <div id="content"> | 1592 | <div id="content"> |
-
请 注册 或 登录 后发表评论