Page Menu
Home
Code
Search
Configure Global Search
Log In
Files
F947293
positioning.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
positioning.js
View Options
/*
Copyright (c) 2004-2009, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details
*/
if
(
!
dojo
.
_hasResource
[
"dojox.drawing.util.positioning"
]){
dojo
.
_hasResource
[
"dojox.drawing.util.positioning"
]
=
true
;
dojo
.
provide
(
"dojox.drawing.util.positioning"
);
(
function
(){
var
_1
=
4
;
var
_2
=
20
;
dojox
.
drawing
.
util
.
positioning
.
label
=
function
(
_3
,
_4
){
var
x
=
0.5
*
(
_3
.
x
+
_4
.
x
);
var
y
=
0.5
*
(
_3
.
y
+
_4
.
y
);
var
_5
=
dojox
.
drawing
.
util
.
common
.
slope
(
_3
,
_4
);
var
_6
=
_1
/
Math
.
sqrt
(
1
+
_5
*
_5
);
if
(
_4
.
y
>
_3
.
y
){
_6
=-
_6
;
}
x
+=-
_6
*
_5
;
y
+=
_6
;
var
_7
=
_4
.
x
<
_3
.
x
?
"end"
:
"start"
;
if
(
_4
.
y
>
_3
.
y
){
y
-=
_2
;
}
return
{
x
:
x
,
y
:
y
,
foo
:
"bar"
,
align
:
_7
};
};
dojox
.
drawing
.
util
.
positioning
.
angle
=
function
(
_8
,
_9
){
var
x
=
0.7
*
_8
.
x
+
0.3
*
_9
.
x
;
var
y
=
0.7
*
_8
.
y
+
0.3
*
_9
.
y
;
var
_a
=
dojox
.
drawing
.
util
.
common
.
slope
(
_8
,
_9
);
var
_b
=
_1
/
Math
.
sqrt
(
1
+
_a
*
_a
);
if
(
_9
.
x
<
_8
.
x
){
_b
=-
_b
;
}
x
+=-
_b
*
_a
;
y
+=
_b
;
var
_c
=
_9
.
y
>
_8
.
y
?
"end"
:
"start"
;
y
+=
_9
.
x
>
_8
.
x
?
0.5
*
_2
:-
0.5
*
_2
;
return
{
x
:
x
,
y
:
y
,
align
:
_c
};
};
})();
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Apr 26, 11:13 (1 d, 14 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
26642
Default Alt Text
positioning.js (1 KB)
Attached To
rZED Zed
Event Timeline
Log In to Comment