Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
胡斌
/
liveAssistant_web_demo
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
胡斌
6 years ago
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
815cfbe836c263ce2c5408c8ff8dda0ac88b57d3
815cfbe8
1 parent
0261c151
add slider to select pen width,improve rotate
隐藏空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
49 行增加
和
13 行删除
demo.html
demo.html
查看文件 @
815cfbe
...
...
@@ -25,7 +25,9 @@
<title>
LiveAssistant Demo
</title>
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=utf-8"
/>
<link
rel=
"stylesheet"
href=
"./jqx/styles/jqx.base.css"
type=
"text/css"
/>
<link
rel=
"stylesheet"
href=
"./jqx/styles/jquery-ui.css"
/>
<script
type=
"text/javascript"
src=
"./jqx/jquery-1.11.1.min.js"
></script>
<script
type=
"text/javascript"
src=
"./jqx/jquery-ui.min.js"
></script>
<script
type=
"text/javascript"
src=
"./jqx/jqxcore.js"
></script>
<script
type=
"text/javascript"
src=
"./jqx/jqxtabs.js"
></script>
<style
type=
"text/css"
>
...
...
@@ -419,6 +421,22 @@
var
rotate_degree
=
0
;
var
pressure_level
=
2048.0
;
$
(
function
()
{
$
(
"#line_width_slider"
).
slider
({
range
:
true
,
min
:
1
,
max
:
50
,
values
:
[
2
,
32
],
slide
:
function
(
event
,
ui
)
{
$
(
"#line_width"
).
val
(
ui
.
values
[
0
]
/
10.0
+
" - "
+
ui
.
values
[
1
]
/
10.0
);
kWIDTH_MIN
=
ui
.
values
[
0
]
/
10.0
;
kWIDTH_MAX
=
ui
.
values
[
1
]
/
10.0
;
}
});
$
(
"#line_width"
).
val
(
$
(
"#line_width_slider"
).
slider
(
"values"
,
0
)
/
10.0
+
" - "
+
$
(
"#line_width_slider"
).
slider
(
"values"
,
1
)
/
10.0
);
}
);
function
setStrokeWidth
(
strokeWidth
)
{
strokeWidth
=
strokeWidth
;
...
...
@@ -485,7 +503,7 @@
function
onTouchDownEvent
(
x
,
y
,
p
)
{
previousPoint
=
null
;
currentPoint
=
null
;
currentPoint
=
new
Point
(
x
,
y
,
p
);
currentPoint
=
new
Point
(
x
,
y
,
0
);
previousPoint
=
currentPoint
;
}
...
...
@@ -569,6 +587,7 @@
var
start
=
function
(
e
)
{
clicked
=
1
;
ctx
.
beginPath
();
ctx
.
lineWidth
=
kWIDTH_MIN
;
x
=
e
.
pageX
;
y
=
e
.
pageY
-
voffset
;
ctx
.
moveTo
(
x
,
y
);
...
...
@@ -1339,19 +1358,19 @@
rotate_degree
=
0
;
}
if
(
rotate_degree
==
0
||
rotate_gree
==
180
)
{
var
w
=
ext_input_panel_height
*
1.0
;
var
h
=
ext_input_panel_width
*
1.0
;
if
(
rotate_degree
==
0
||
rotate_degree
==
180
)
{
var
w
=
ext_input_panel_width
*
1.0
;
var
h
=
ext_input_panel_height
*
1.0
;
var
canvasw
=
w
/
h
*
canvas_height
;
ratio_x
=
(
canvasw
+
0.0
)
/
w
;
ratio_y
=
(
canvas_height
+
0.0
)
/
h
;
}
else
{
var
w
=
ext_input_panel_width
*
1.0
;
var
h
=
ext_input_panel_height
*
1.0
;
var
w
=
ext_input_panel_height
*
1.0
;
var
h
=
ext_input_panel_width
*
1.0
;
var
canvasw
=
w
/
h
*
canvas_height
;
ratio_x
=
(
canvasw
+
0.0
)
/
ext_input_panel_width
;
ratio_y
=
(
canvas_height
+
0.0
)
/
ext_input_panel_height
;
ratio_x
=
(
canvasw
+
0.0
)
/
w
;
ratio_y
=
(
canvas_height
+
0.0
)
/
h
;
}
return
;
...
...
@@ -1942,10 +1961,9 @@
</td><td
><div
style=
"height:600px; overflow:scroll;"
><div
id=
"output"
/></div></td>
</tr>
</table>
</div>
<div>
<div
id=
"page"
>
<div
class=
"header"
>
<select
id=
"pen_type"
name=
"pen_type"
><option
value =
"PendoTech"
>
PendoTech PH-1820-A
</option><option
value =
"robot"
>
Nebula T7
</option></select>
<a
id=
"new"
class=
"navbtn"
onclick=
"newCanvas()"
>
New
</a>
<a
id=
"open_ext_input"
class=
"navbtn"
onclick=
"onTestClick(this)"
>
open_ext_input
</a>
<a
id=
"close_ext_input"
class=
"navbtn"
onclick=
"onTestClick(this)"
>
close_ext_input
</a>
...
...
@@ -1967,12 +1985,30 @@
<div
class=
"palette-box"
>
<div
class=
"palette black"
onclick=
"selectColor(this)"
></div>
</div>
</div>
<table
width =
"500"
align=
"top"
>
<tr>
<td><label
for=
"line_width"
style=
"color:#a3bd97;"
>
line width:
</label></td>
<td>
<table
width =
"100"
>
<tr>
<td
id=
"line_width_slider"
></td>
</tr>
</table>
</td>
<td><input
type=
"text"
id=
"line_width"
size=
"10"
readonly
style=
"border:0; color:#f6931f; font-weight:bold;"
/></td>
>
<td
colspan=
"2"
><select
id=
"pen_type"
name=
"pen_type"
><option
value =
"PendoTech"
>
PendoTech PH-1820-A
</option><option
value =
"robot"
>
Nebula T7
</option></select></td>
</tr>
</table>
</div>
<div
id=
"content"
>
<p
style=
"text-align:center"
>
Loading Canvas...
</p>
</div>
</div>
</div>
</div>
<div>
<table>
<tr>
...
...
请
注册
或
登录
后发表评论