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
c44bb887
Commit
c44bb887
authored
Jun 07, 2017
by
SergeyLuzyanin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix Bug 35081
parent
2a02978c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
98 additions
and
7 deletions
+98
-7
common/Drawings/Format/GraphicObjectBase.js
common/Drawings/Format/GraphicObjectBase.js
+37
-0
slide/Editor/Format/Layout.js
slide/Editor/Format/Layout.js
+26
-2
slide/Editor/Format/Slide.js
slide/Editor/Format/Slide.js
+9
-0
slide/Editor/Format/SlideMaster.js
slide/Editor/Format/SlideMaster.js
+26
-5
No files found.
common/Drawings/Format/GraphicObjectBase.js
View file @
c44bb887
...
...
@@ -288,6 +288,43 @@
this
.
w
=
this
.
r
-
this
.
l
;
this
.
h
=
this
.
b
-
this
.
t
;
};
CGraphicBounds
.
prototype
.
checkByOther
=
function
(
oBounds
){
if
(
oBounds
){
if
(
oBounds
.
l
<
this
.
l
){
this
.
l
=
oBounds
.
l
;
}
if
(
oBounds
.
t
<
this
.
t
){
this
.
t
=
oBounds
.
t
;
}
if
(
oBounds
.
r
>
this
.
r
){
this
.
r
=
oBounds
.
r
;
}
if
(
oBounds
.
b
>
this
.
b
){
this
.
b
=
oBounds
.
b
;
}
}
};
CGraphicBounds
.
prototype
.
checkWH
=
function
(){
this
.
x
=
this
.
l
;
this
.
y
=
this
.
t
;
this
.
w
=
this
.
r
-
this
.
l
;
this
.
h
=
this
.
b
-
this
.
t
;
};
CGraphicBounds
.
prototype
.
reset
=
function
(
l
,
t
,
r
,
b
){
this
.
l
=
l
;
this
.
t
=
t
;
this
.
r
=
r
;
this
.
b
=
b
;
this
.
x
=
l
;
this
.
y
=
t
;
this
.
w
=
r
-
l
;
this
.
h
=
b
-
t
;
};
/**
* Base class for all graphic objects
* @constructor
...
...
slide/Editor/Format/Layout.js
View file @
c44bb887
...
...
@@ -108,10 +108,13 @@ function SlideLayout()
this
.
Master
=
null
;
this
.
maxId
=
1000
;
this
.
bounds
=
new
AscFormat
.
CGraphicBounds
(
0.0
,
0.0
,
0.0
,
0.0
);
this
.
recalcInfo
=
{
recalculateBackground
:
true
,
recalculateSpTree
:
true
recalculateSpTree
:
true
,
recalculateBounds
:
true
};
...
...
@@ -294,11 +297,32 @@ SlideLayout.prototype =
var
_shapes
=
this
.
cSld
.
spTree
;
var
_shape_index
;
var
_shape_count
=
_shapes
.
length
;
var
bRecalculateBounds
=
this
.
recalcInfo
.
recalculateBounds
;
if
(
bRecalculateBounds
){
this
.
bounds
.
reset
(
this
.
Width
+
100.0
,
this
.
Height
+
100.0
,
-
100.0
,
-
100.0
);
}
var
bChecked
=
false
;
for
(
_shape_index
=
0
;
_shape_index
<
_shape_count
;
++
_shape_index
)
{
if
(
!
_shapes
[
_shape_index
].
isPlaceholder
())
if
(
!
_shapes
[
_shape_index
].
isPlaceholder
())
{
_shapes
[
_shape_index
].
recalculate
();
if
(
bRecalculateBounds
){
this
.
bounds
.
checkByOther
(
_shapes
[
_shape_index
].
bounds
);
}
bChecked
=
true
;
}
}
if
(
bRecalculateBounds
){
if
(
bChecked
){
this
.
bounds
.
checkWH
();
}
else
{
this
.
bounds
.
reset
(
0.0
,
0.0
,
0.0
,
0.0
);
}
this
.
recalcInfo
.
recalculateBounds
=
false
;
}
},
recalculate2
:
function
()
...
...
slide/Editor/Format/Slide.js
View file @
c44bb887
...
...
@@ -1033,15 +1033,24 @@ Slide.prototype =
draw
:
function
(
graphics
)
{
var
_bounds
;
DrawBackground
(
graphics
,
this
.
backgroundFill
,
this
.
Width
,
this
.
Height
);
if
(
this
.
showMasterSp
===
true
||
(
!
(
this
.
showMasterSp
===
false
)
&&
(
this
.
Layout
.
showMasterSp
==
undefined
||
this
.
Layout
.
showMasterSp
)))
{
if
(
graphics
.
IsSlideBoundsCheckerType
===
undefined
)
this
.
Layout
.
Master
.
draw
(
graphics
);
else
if
(
graphics
.
IsSlideBoundsCheckerType
){
_bounds
=
this
.
Layout
.
Master
.
bounds
;
graphics
.
rect
(
_bounds
.
l
,
_bounds
.
t
,
_bounds
.
w
,
_bounds
.
h
);
}
}
if
(
graphics
&&
graphics
.
IsSlideBoundsCheckerType
===
undefined
)
this
.
Layout
.
draw
(
graphics
);
else
{
_bounds
=
this
.
Layout
.
bounds
;
graphics
.
rect
(
_bounds
.
l
,
_bounds
.
t
,
_bounds
.
w
,
_bounds
.
h
);
}
for
(
var
i
=
0
;
i
<
this
.
cSld
.
spTree
.
length
;
++
i
)
{
this
.
cSld
.
spTree
[
i
].
draw
(
graphics
);
...
...
slide/Editor/Format/SlideMaster.js
View file @
c44bb887
...
...
@@ -110,6 +110,7 @@ function MasterSlide(presentation, theme)
this
.
DrawingDocument
=
editor
.
WordControl
.
m_oDrawingDocument
;
this
.
maxId
=
1000
;
this
.
bounds
=
new
AscFormat
.
CGraphicBounds
(
0
,
0
,
this
.
Width
,
this
.
Height
);
//----------------------------------------------
this
.
presentation
=
editor
.
WordControl
.
m_oLogicDocument
;
...
...
@@ -119,7 +120,9 @@ function MasterSlide(presentation, theme)
this
.
recalcInfo
=
{
recalculateBackground
:
true
,
recalculateSpTree
:
true
recalculateSpTree
:
true
,
recalculateBounds
:
true
};
...
...
@@ -157,6 +160,7 @@ MasterSlide.prototype =
this
.
Id
=
r
.
GetString2
();
this
.
theme
=
AscFormat
.
readObject
(
r
);
},
draw
:
function
(
graphics
)
{
for
(
var
i
=
0
;
i
<
this
.
cSld
.
spTree
.
length
;
++
i
)
...
...
@@ -166,8 +170,6 @@ MasterSlide.prototype =
}
},
getMatchingLayout
:
function
(
type
,
matchingName
,
cSldName
,
themeFlag
)
{
var
layoutType
=
type
;
...
...
@@ -253,7 +255,6 @@ MasterSlide.prototype =
return
this
.
sldLayoutLst
[
0
];
},
getMatchingShape
:
Slide
.
prototype
.
getMatchingShape
,
/*function(type, idx, bSingleBody)
{
var _input_reduced_type;
...
...
@@ -393,12 +394,32 @@ MasterSlide.prototype =
var
_shapes
=
this
.
cSld
.
spTree
;
var
_shape_index
;
var
_shape_count
=
_shapes
.
length
;
var
bRecalculateBounds
=
this
.
recalcInfo
.
recalculateBounds
;
if
(
bRecalculateBounds
){
this
.
bounds
.
reset
(
this
.
Width
+
100.0
,
this
.
Height
+
100.0
,
-
100.0
,
-
100.0
);
}
var
bChecked
=
false
;
for
(
_shape_index
=
0
;
_shape_index
<
_shape_count
;
++
_shape_index
)
{
if
(
!
_shapes
[
_shape_index
].
isPlaceholder
())
if
(
!
_shapes
[
_shape_index
].
isPlaceholder
())
{
_shapes
[
_shape_index
].
recalculate
();
if
(
bRecalculateBounds
){
this
.
bounds
.
checkByOther
(
_shapes
[
_shape_index
].
bounds
);
}
bChecked
=
true
;
}
}
if
(
bRecalculateBounds
){
if
(
bChecked
){
this
.
bounds
.
checkWH
();
}
else
{
this
.
bounds
.
reset
(
0.0
,
0.0
,
0.0
,
0.0
);
}
this
.
recalcInfo
.
recalculateBounds
=
false
;
}
},
checkSlideSize
:
Slide
.
prototype
.
checkSlideSize
,
...
...
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