Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sdkjs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
sdkjs
Commits
b57ecbf7
Commit
b57ecbf7
authored
Aug 30, 2016
by
alexey.musinov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[mobile] word select text
parent
67b11d9e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
98 deletions
+43
-98
common/Native/Wrappers/DrawingDocument.js
common/Native/Wrappers/DrawingDocument.js
+43
-98
No files found.
common/Native/Wrappers/DrawingDocument.js
View file @
b57ecbf7
...
...
@@ -626,6 +626,9 @@ CDrawingDocument.prototype =
this
.
m_oApi
.
DocumentUrl
=
""
;
this
.
LogicDocument
=
window
.
editor
.
WordControl
.
m_oLogicDocument
;
this
.
LogicDocument
.
DrawingDocument
=
this
;
this
.
selectionMatrix
=
null
;
this
.
isSelectionMatrix
=
false
;
},
RenderPage
:
function
(
nPageIndex
)
{
...
...
@@ -781,11 +784,11 @@ CDrawingDocument.prototype =
this
.
Native
[
"
DD_UpdateTargetTransform
"
](
matrix
.
sx
,
matrix
.
shy
,
matrix
.
shx
,
matrix
.
sy
,
matrix
.
tx
,
matrix
.
ty
);
}
//
else
//
{
//
this.TextMatrix = null;
//
this.Native["DD_RemoveTargetTransform"]();
//
}
else
{
this
.
TextMatrix
=
null
;
this
.
Native
[
"
DD_RemoveTargetTransform
"
]();
}
},
UpdateTarget
:
function
(
x
,
y
,
pageIndex
)
{
...
...
@@ -900,6 +903,7 @@ CDrawingDocument.prototype =
},
AddPageSelection
:
function
(
pageIndex
,
x
,
y
,
w
,
h
)
{
this
.
selectionMatrix
=
this
.
TextMatrix
;
this
.
Native
[
"
DD_AddPageSelection
"
](
pageIndex
,
x
,
y
,
w
,
h
);
},
OnSelectEnd
:
function
()
...
...
@@ -1329,6 +1333,8 @@ CDrawingDocument.prototype =
},
OnUpdateOverlay
:
function
()
{
isSelectionMatrix
=
false
;
if
(
this
.
IsUpdateOverlayOnlyEnd
)
{
this
.
IsUpdateOverlayOnEndCheck
=
true
;
...
...
@@ -1455,6 +1461,8 @@ CDrawingDocument.prototype =
// 1 - select markers
// 2 - drawing track
var
matrixCheck
=
this
.
selectionMatrix
;
// this.TextMatrix
check_MouseDownEvent
(
e
,
false
);
var
pos
=
null
;
...
...
@@ -1480,7 +1488,7 @@ CDrawingDocument.prototype =
var
_circlePos2_x
=
0
;
var
_circlePos2_y
=
0
;
if
(
!
this
.
TextMatrix
)
if
(
!
matrixCheck
)
{
_circlePos1_x
=
this
.
SelectRect1
.
X
;
_circlePos1_y
=
this
.
SelectRect1
.
Y
-
radiusMM
;
...
...
@@ -1496,10 +1504,10 @@ CDrawingDocument.prototype =
var
_circlePos2_x_mem
=
this
.
SelectRect2
.
X
+
this
.
SelectRect2
.
W
;
var
_circlePos2_y_mem
=
this
.
SelectRect2
.
Y
+
this
.
SelectRect2
.
H
+
radiusMM
;
_circlePos1_x
=
this
.
TextMatrix
.
TransformPointX
(
_circlePos1_x_mem
,
_circlePos1_y_mem
);
_circlePos1_y
=
this
.
TextMatrix
.
TransformPointY
(
_circlePos1_x_mem
,
_circlePos1_y_mem
);
_circlePos2_x
=
this
.
TextMatrix
.
TransformPointX
(
_circlePos2_x_mem
,
_circlePos2_y_mem
);
_circlePos2_y
=
this
.
TextMatrix
.
TransformPointY
(
_circlePos2_x_mem
,
_circlePos2_y_mem
);
_circlePos1_x
=
matrixCheck
.
TransformPointX
(
_circlePos1_x_mem
,
_circlePos1_y_mem
);
_circlePos1_y
=
matrixCheck
.
TransformPointY
(
_circlePos1_x_mem
,
_circlePos1_y_mem
);
_circlePos2_x
=
matrixCheck
.
TransformPointX
(
_circlePos2_x_mem
,
_circlePos2_y_mem
);
_circlePos2_y
=
matrixCheck
.
TransformPointY
(
_circlePos2_x_mem
,
_circlePos2_y_mem
);
}
var
_selectCircleEpsMM
=
10
;
// 1cm;
...
...
@@ -1519,43 +1527,12 @@ CDrawingDocument.prototype =
this
.
SelectDrag
=
1
;
this
.
LogicDocument
.
Cursor_MoveRight
();
/*
это старая версия. грамотная реализация - моус даун и ап с шифтом. Так и проще и правильнее
var _xDown = this.SelectRect2.X + this.SelectRect2.W;
var _yDown = this.SelectRect2.Y + this.SelectRect2.H / 2;
if (!this.TextMatrix)
{
this.LogicDocumentOnMouseDown(global_mouseEvent, _xDown, _yDown, this.SelectRect2.Page);
}
else
{
this.LogicDocumentOnMouseDown(global_mouseEvent, this.TextMatrix.TransformPointX(_xDown, _yDown),
this.TextMatrix.TransformPointY(_xDown, _yDown), this.SelectRect2.Page);
}
//теперь сдвиги
var _xStamp = this.SelectRect1.X;
var _yStamp = this.SelectRect1.Y;
if (this.TextMatrix)
{
_xStamp = this.TextMatrix.TransformPointX(this.SelectRect1.X, this.SelectRect1.Y);
_yStamp = this.TextMatrix.TransformPointY(this.SelectRect1.X, this.SelectRect1.Y);
}
var ret = this.__DD_ConvertCoordsToCursor(_xStamp, _yStamp, this.SelectRect1.Page);
var ret2 = this.CorrectMouseSelectPosition(Math.min(this.SelectMobileConstantOffsetEpsilon, this.SelectRect1.H / 2));
this.SelectMobileXOffset = (ret.X + ret2.X) - global_mouseEvent.X;
this.SelectMobileYOffset = (ret.Y + ret2.Y) - global_mouseEvent.Y;
this.OnMouseMove(e);
*/
var
_xStamp
=
this
.
SelectRect1
.
X
;
var
_yStamp
=
this
.
SelectRect1
.
Y
;
if
(
this
.
TextMatrix
)
if
(
matrixCheck
)
{
_xStamp
=
this
.
TextMatrix
.
TransformPointX
(
this
.
SelectRect1
.
X
,
this
.
SelectRect1
.
Y
);
_yStamp
=
this
.
TextMatrix
.
TransformPointY
(
this
.
SelectRect1
.
X
,
this
.
SelectRect1
.
Y
);
_xStamp
=
matrixCheck
.
TransformPointX
(
this
.
SelectRect1
.
X
,
this
.
SelectRect1
.
Y
);
_yStamp
=
matrixCheck
.
TransformPointY
(
this
.
SelectRect1
.
X
,
this
.
SelectRect1
.
Y
);
}
var
ret
=
this
.
__DD_ConvertCoordsToCursor
(
_xStamp
,
_yStamp
,
this
.
SelectRect1
.
Page
);
...
...
@@ -1582,45 +1559,13 @@ CDrawingDocument.prototype =
this
.
SelectDrag
=
2
;
this
.
LogicDocument
.
Cursor_MoveLeft
();
/*
это старая версия. грамотная реализация - моус даун и ап с шифтом. Так и проще и правильнее
var _xDown = this.SelectRect1.X;
var _yDown = this.SelectRect1.Y + this.SelectRect1.H / 2;
if (!this.TextMatrix)
{
this.LogicDocumentOnMouseDown(global_mouseEvent, _xDown, _yDown, this.SelectRect1.Page);
}
else
{
this.LogicDocumentOnMouseDown(global_mouseEvent, this.TextMatrix.TransformPointX(_xDown, _yDown),
this.TextMatrix.TransformPointY(_xDown, _yDown), this.SelectRect1.Page);
}
//теперь сдвиги
var _xStamp = this.SelectRect2.X + this.SelectRect2.W;
var _yStamp = this.SelectRect2.Y + this.SelectRect2.H;
if (this.TextMatrix)
{
var _xTmp = _xStamp;
_xStamp = this.TextMatrix.TransformPointX(_xTmp, _yStamp);
_yStamp = this.TextMatrix.TransformPointY(_xTmp, _yStamp);
}
var ret = this.__DD_ConvertCoordsToCursor(_xStamp, _yStamp, this.SelectRect2.Page);
var ret2 = this.CorrectMouseSelectPosition(Math.min(this.SelectMobileConstantOffsetEpsilon, this.SelectRect2.H / 2));
this.SelectMobileXOffset = (ret.X - ret2.X) - global_mouseEvent.X;
this.SelectMobileYOffset = (ret.Y - ret2.Y) - global_mouseEvent.Y;
this.OnMouseMove(e);
*/
var
_xStamp
=
this
.
SelectRect2
.
X
+
this
.
SelectRect2
.
W
;
var
_yStamp
=
this
.
SelectRect2
.
Y
+
this
.
SelectRect2
.
H
;
if
(
this
.
TextMatrix
)
if
(
matrixCheck
)
{
var
_xTmp
=
_xStamp
;
_xStamp
=
this
.
TextMatrix
.
TransformPointX
(
_xTmp
,
_yStamp
);
_yStamp
=
this
.
TextMatrix
.
TransformPointY
(
_xTmp
,
_yStamp
);
_xStamp
=
matrixCheck
.
TransformPointX
(
_xTmp
,
_yStamp
);
_yStamp
=
matrixCheck
.
TransformPointY
(
_xTmp
,
_yStamp
);
}
var
ret
=
this
.
__DD_ConvertCoordsToCursor
(
_xStamp
,
_yStamp
,
this
.
SelectRect2
.
Page
);
...
...
@@ -1859,12 +1804,12 @@ CDrawingDocument.prototype =
var
xOff
=
0
;
var
yOff
=
1
;
if
(
null
!=
this
.
Text
Matrix
)
if
(
null
!=
this
.
selection
Matrix
)
{
var
xOff1
=
this
.
Text
Matrix
.
TransformPointX
(
0
,
0
);
var
yOff1
=
this
.
Text
Matrix
.
TransformPointY
(
0
,
0
);
var
xOff2
=
this
.
Text
Matrix
.
TransformPointX
(
0
,
1
);
var
yOff2
=
this
.
Text
Matrix
.
TransformPointY
(
0
,
1
);
var
xOff1
=
this
.
selection
Matrix
.
TransformPointX
(
0
,
0
);
var
yOff1
=
this
.
selection
Matrix
.
TransformPointY
(
0
,
0
);
var
xOff2
=
this
.
selection
Matrix
.
TransformPointX
(
0
,
1
);
var
yOff2
=
this
.
selection
Matrix
.
TransformPointY
(
0
,
1
);
// по идее скэйла нет. но на всякий
var
_len
=
Math
.
sqrt
((
xOff1
-
xOff2
)
*
(
xOff1
-
xOff2
)
+
(
yOff1
-
yOff2
)
*
(
yOff1
-
yOff2
));
...
...
@@ -1903,14 +1848,14 @@ CDrawingDocument.prototype =
_ret
.
push
(
this
.
TargetPos
.
Y
);
_ret
.
push
(
this
.
TargetPos
.
Page
);
if
(
this
.
TextMatrix
&&
!
this
.
Text
Matrix
.
IsIdentity
())
if
(
this
.
selectionMatrix
&&
!
this
.
selection
Matrix
.
IsIdentity
())
{
_ret
.
push
(
this
.
Text
Matrix
.
sx
);
_ret
.
push
(
this
.
Text
Matrix
.
shy
);
_ret
.
push
(
this
.
Text
Matrix
.
shx
);
_ret
.
push
(
this
.
Text
Matrix
.
sy
);
_ret
.
push
(
this
.
Text
Matrix
.
tx
);
_ret
.
push
(
this
.
Text
Matrix
.
ty
);
_ret
.
push
(
this
.
selection
Matrix
.
sx
);
_ret
.
push
(
this
.
selection
Matrix
.
shy
);
_ret
.
push
(
this
.
selection
Matrix
.
shx
);
_ret
.
push
(
this
.
selection
Matrix
.
sy
);
_ret
.
push
(
this
.
selection
Matrix
.
tx
);
_ret
.
push
(
this
.
selection
Matrix
.
ty
);
}
return
_ret
;
...
...
@@ -1949,14 +1894,14 @@ CDrawingDocument.prototype =
_ret
.
push
(
_select
.
End
.
Y
+
_select
.
End
.
H
);
_ret
.
push
(
_select
.
End
.
Page
);
if
(
this
.
TextMatrix
&&
!
this
.
Text
Matrix
.
IsIdentity
())
if
(
this
.
selectionMatrix
&&
!
this
.
selection
Matrix
.
IsIdentity
())
{
_ret
.
push
(
this
.
Text
Matrix
.
sx
);
_ret
.
push
(
this
.
Text
Matrix
.
shy
);
_ret
.
push
(
this
.
Text
Matrix
.
shx
);
_ret
.
push
(
this
.
Text
Matrix
.
sy
);
_ret
.
push
(
this
.
Text
Matrix
.
tx
);
_ret
.
push
(
this
.
Text
Matrix
.
ty
);
_ret
.
push
(
this
.
selection
Matrix
.
sx
);
_ret
.
push
(
this
.
selection
Matrix
.
shy
);
_ret
.
push
(
this
.
selection
Matrix
.
shx
);
_ret
.
push
(
this
.
selection
Matrix
.
sy
);
_ret
.
push
(
this
.
selection
Matrix
.
tx
);
_ret
.
push
(
this
.
selection
Matrix
.
ty
);
}
return
_ret
;
...
...
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