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
6dd1dff3
Commit
6dd1dff3
authored
Jul 24, 2017
by
SergeyLuzyanin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move drawing locks to base class
parent
7901e4ab
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
62 additions
and
105 deletions
+62
-105
common/Charts/DrawingArea.js
common/Charts/DrawingArea.js
+11
-6
common/Drawings/Format/ChartSpace.js
common/Drawings/Format/ChartSpace.js
+2
-24
common/Drawings/Format/GraphicFrame.js
common/Drawings/Format/GraphicFrame.js
+2
-4
common/Drawings/Format/GraphicObjectBase.js
common/Drawings/Format/GraphicObjectBase.js
+44
-0
common/Drawings/Format/GroupShape.js
common/Drawings/Format/GroupShape.js
+1
-23
common/Drawings/Format/Image.js
common/Drawings/Format/Image.js
+1
-23
common/Drawings/Format/Shape.js
common/Drawings/Format/Shape.js
+1
-25
No files found.
common/Charts/DrawingArea.js
View file @
6dd1dff3
...
...
@@ -564,12 +564,17 @@ function FrozenPlace(ws, type) {
object
.
graphicObject
.
draw
(
canvas
.
shapeCtx
);
// Lock
if
(
(
object
.
graphicObject
.
lockType
!=
undefined
)
&&
(
object
.
graphicObject
.
lockType
!=
AscCommon
.
c_oAscLockTypes
.
kLockTypeNone
)
)
{
canvas
.
shapeCtx
.
SetIntegerGrid
(
false
);
canvas
.
shapeCtx
.
transform3
(
object
.
graphicObject
.
transform
,
false
);
canvas
.
shapeCtx
.
DrawLockObjectRect
(
object
.
graphicObject
.
lockType
,
0
,
0
,
object
.
graphicObject
.
extX
,
object
.
graphicObject
.
extY
);
canvas
.
shapeCtx
.
reset
();
canvas
.
shapeCtx
.
SetIntegerGrid
(
true
);
if
(
(
object
.
graphicObject
.
lockType
!==
undefined
)
&&
(
object
.
graphicObject
.
lockType
!==
AscCommon
.
c_oAscLockTypes
.
kLockTypeNone
)
)
{
var
oApi
=
Asc
[
'
editor
'
];
if
(
oApi
){
if
(
!
oApi
.
collaborativeEditing
.
getFast
()
||
object
.
graphicObject
.
lockType
!==
AscCommon
.
c_oAscLockTypes
.
kLockTypeMine
){
canvas
.
shapeCtx
.
SetIntegerGrid
(
false
);
canvas
.
shapeCtx
.
transform3
(
object
.
graphicObject
.
transform
,
false
);
canvas
.
shapeCtx
.
DrawLockObjectRect
(
object
.
graphicObject
.
lockType
,
0
,
0
,
object
.
graphicObject
.
extX
,
object
.
graphicObject
.
extY
);
canvas
.
shapeCtx
.
reset
();
canvas
.
shapeCtx
.
SetIntegerGrid
(
true
);
}
}
}
_this
.
restore
(
canvas
.
shapeCtx
);
...
...
common/Drawings/Format/ChartSpace.js
View file @
6dd1dff3
...
...
@@ -10851,30 +10851,8 @@ CChartSpace.prototype.draw = function(graphics)
}
}
graphics
.
RestoreGrState
();
if
(
!
this
.
group
)
{
var
oLock
;
if
(
this
.
parent
instanceof
ParaDrawing
)
{
oLock
=
this
.
parent
.
Lock
;
}
else
if
(
this
.
Lock
)
{
oLock
=
this
.
Lock
;
}
if
(
oLock
&&
AscCommon
.
locktype_None
!=
oLock
.
Get_Type
())
{
graphics
.
SaveGrState
();
var
bCoMarksDraw
=
true
;
if
(
typeof
editor
!==
"
undefined
"
&&
editor
&&
AscFormat
.
isRealBool
(
editor
.
isCoMarksDraw
)){
bCoMarksDraw
=
editor
.
isCoMarksDraw
;
}
if
(
bCoMarksDraw
){
graphics
.
transform3
(
this
.
transform
);
graphics
.
DrawLockObjectRect
(
oLock
.
Get_Type
(),
0
,
0
,
this
.
extX
,
this
.
extY
);
}
graphics
.
RestoreGrState
();
}
if
(
this
.
drawLocks
(
this
.
transform
,
graphics
)){
graphics
.
RestoreGrState
();
}
};
...
...
common/Drawings/Format/GraphicFrame.js
View file @
6dd1dff3
...
...
@@ -816,13 +816,11 @@ CGraphicFrame.prototype.draw = function(graphics)
}
if
(
this
.
graphicObject
)
{
graphics
.
transform3
(
this
.
transform
);
graphics
.
SetIntegerGrid
(
true
);
this
.
graphicObject
.
Draw
(
0
,
graphics
);
if
(
AscCommon
.
locktype_None
!=
this
.
Lock
.
Get_Type
()
&&
!
this
.
group
)
graphics
.
DrawLockObjectRect
(
this
.
Lock
.
Get_Type
()
,
0
,
0
,
this
.
extX
,
this
.
extY
);
graphics
.
reset
();
graphics
.
SetIntegerGrid
(
true
);
this
.
drawLocks
(
this
.
transform
,
graphics
);
}
};
...
...
common/Drawings/Format/GraphicObjectBase.js
View file @
6dd1dff3
...
...
@@ -1042,6 +1042,50 @@
}
};
CGraphicObjectBase
.
prototype
.
drawLocks
=
function
(
transform
,
graphics
){
var
bNotes
=
!!
(
this
.
parent
&&
this
.
parent
.
kind
===
AscFormat
.
TYPE_KIND
.
NOTES
);
if
(
!
this
.
group
&&
!
bNotes
)
{
var
oLock
;
if
(
this
.
parent
instanceof
ParaDrawing
)
{
oLock
=
this
.
parent
.
Lock
;
}
else
if
(
this
.
Lock
)
{
oLock
=
this
.
Lock
;
}
if
(
oLock
&&
AscCommon
.
locktype_None
!==
oLock
.
Get_Type
())
{
var
bCoMarksDraw
=
true
;
var
oApi
=
editor
||
Asc
[
'
editor
'
];
if
(
oApi
){
switch
(
oApi
.
getEditorId
()){
case
AscCommon
.
c_oEditorId
.
Word
:{
bCoMarksDraw
=
(
true
===
oApi
.
isCoMarksDraw
||
AscCommon
.
locktype_Mine
!==
oLock
.
Get_Type
());
break
;
}
case
AscCommon
.
c_oEditorId
.
Presentation
:{
bCoMarksDraw
=
(
!
AscCommon
.
CollaborativeEditing
.
Is_Fast
()
||
AscCommon
.
locktype_Mine
!==
oLock
.
Get_Type
());
break
;
}
case
AscCommon
.
c_oEditorId
.
Spreadsheet
:{
bCoMarksDraw
=
(
!
oApi
.
collaborativeEditing
.
getFast
()
||
AscCommon
.
locktype_Mine
!==
oLock
.
Get_Type
());
break
;
}
}
}
if
(
bCoMarksDraw
){
graphics
.
transform3
(
transform
);
graphics
.
DrawLockObjectRect
(
oLock
.
Get_Type
(),
0
,
0
,
this
.
extX
,
this
.
extY
);
return
true
;
}
}
}
return
false
;
};
window
[
'
AscFormat
'
]
=
window
[
'
AscFormat
'
]
||
{};
window
[
'
AscFormat
'
].
CGraphicObjectBase
=
CGraphicObjectBase
;
window
[
'
AscFormat
'
].
CGraphicBounds
=
CGraphicBounds
;
...
...
common/Drawings/Format/GroupShape.js
View file @
6dd1dff3
...
...
@@ -410,29 +410,7 @@ function CGroupShape()
this
.
spTree
[
i
].
draw
(
graphics
);
if
(
!
this
.
group
)
{
var
oLock
;
if
(
this
.
parent
instanceof
ParaDrawing
)
{
oLock
=
this
.
parent
.
Lock
;
}
else
if
(
this
.
Lock
)
{
oLock
=
this
.
Lock
;
}
if
(
oLock
&&
AscCommon
.
locktype_None
!=
oLock
.
Get_Type
())
{
var
bCoMarksDraw
=
true
;
if
(
typeof
editor
!==
"
undefined
"
&&
editor
&&
AscFormat
.
isRealBool
(
editor
.
isCoMarksDraw
)){
bCoMarksDraw
=
editor
.
isCoMarksDraw
;
}
if
(
bCoMarksDraw
){
graphics
.
transform3
(
this
.
transform
);
graphics
.
DrawLockObjectRect
(
oLock
.
Get_Type
(),
0
,
0
,
this
.
extX
,
this
.
extY
);
}
}
}
this
.
drawLocks
(
this
.
transform
,
graphics
);
graphics
.
reset
();
graphics
.
SetIntegerGrid
(
true
);
};
...
...
common/Drawings/Format/Image.js
View file @
6dd1dff3
...
...
@@ -643,29 +643,7 @@ CImageShape.prototype.draw = function(graphics, transform)
this
.
brush
=
oldBrush
;
this
.
pen
=
oldPen
;
if
(
!
this
.
group
)
{
var
oLock
;
if
(
this
.
parent
instanceof
ParaDrawing
)
{
oLock
=
this
.
parent
.
Lock
;
}
else
if
(
this
.
Lock
)
{
oLock
=
this
.
Lock
;
}
if
(
oLock
&&
AscCommon
.
locktype_None
!=
oLock
.
Get_Type
())
{
var
bCoMarksDraw
=
true
;
if
(
typeof
editor
!==
"
undefined
"
&&
editor
&&
AscFormat
.
isRealBool
(
editor
.
isCoMarksDraw
)){
bCoMarksDraw
=
editor
.
isCoMarksDraw
;
}
if
(
bCoMarksDraw
){
graphics
.
transform3
(
_transform
);
graphics
.
DrawLockObjectRect
(
oLock
.
Get_Type
(),
0
,
0
,
this
.
extX
,
this
.
extY
);
}
}
}
this
.
drawLocks
(
_transform
,
graphics
);
graphics
.
reset
();
graphics
.
SetIntegerGrid
(
true
);
};
...
...
common/Drawings/Format/Shape.js
View file @
6dd1dff3
...
...
@@ -4358,31 +4358,7 @@ CShape.prototype.draw = function (graphics, transform, transformText, pageIndex)
}
}
}
var
bNotes
=
!!
(
this
.
parent
&&
this
.
parent
.
kind
===
AscFormat
.
TYPE_KIND
.
NOTES
);
if
(
!
this
.
group
&&
!
bNotes
)
{
var
oLock
;
if
(
this
.
parent
instanceof
ParaDrawing
)
{
oLock
=
this
.
parent
.
Lock
;
}
else
if
(
this
.
Lock
)
{
oLock
=
this
.
Lock
;
}
if
(
oLock
&&
AscCommon
.
locktype_None
!=
oLock
.
Get_Type
())
{
var
bCoMarksDraw
=
true
;
if
(
typeof
editor
!==
"
undefined
"
&&
editor
&&
AscFormat
.
isRealBool
(
editor
.
isCoMarksDraw
)){
bCoMarksDraw
=
editor
.
isCoMarksDraw
;
}
if
(
bCoMarksDraw
){
graphics
.
transform3
(
_transform
);
graphics
.
DrawLockObjectRect
(
oLock
.
Get_Type
(),
0
,
0
,
this
.
extX
,
this
.
extY
);
}
}
}
this
.
drawLocks
&&
this
.
drawLocks
(
_transform
,
graphics
);
graphics
.
SetIntegerGrid
(
true
);
graphics
.
reset
();
};
...
...
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