Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
scilla-core
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
劳工
scilla-core
Commits
07f8f244
Commit
07f8f244
authored
Mar 26, 2019
by
rockyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
交互上下文增加坐标内转外功能
增加dynamic类型
parent
ac74cb04
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
4 deletions
+12
-4
ReType.ts
src/ReType.ts
+1
-0
InteractContext.ts
src/core/context/InteractContext.ts
+11
-4
No files found.
src/ReType.ts
View file @
07f8f244
...
...
@@ -2,3 +2,4 @@
export
type
color
=
string
;
export
type
resource
=
any
;
export
type
raw
=
any
;
export
type
dynamic
=
string
;
\ No newline at end of file
src/core/context/InteractContext.ts
View file @
07f8f244
...
...
@@ -188,14 +188,21 @@ export function pagePosToCanvasPos(pageX, pageY, identifier?, isLocalPos:boolean
* 画布坐标转页面坐标
* @param x
* @param y
* @param isLocalPos
*/
export
function
canvasPosToPagePos
(
x
,
y
){
let
doc
=
document
.
documentElement
;
let
box
=
_canvas
.
getBoundingClientRect
();
export
function
canvasPosToPagePos
(
x
,
y
,
isLocalPos
:
boolean
=
true
){
x
=
x
*
_scaleX
;
y
=
y
*
_scaleY
;
if
(
!
isLocalPos
){
let
box
=
_canvas
.
getBoundingClientRect
();
let
doc
=
document
.
documentElement
;
let
left
=
box
.
left
+
window
.
pageXOffset
-
doc
.
clientLeft
;
let
top
=
box
.
top
+
window
.
pageYOffset
-
doc
.
clientTop
;
x
+=
left
;
y
+=
top
;
}
return
{
x
,
y
,
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment