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
978f618a
Commit
978f618a
authored
Jun 29, 2017
by
Oleg Korshul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
resize & hor scroll recursion bug
parent
d2c9e39c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
267 additions
and
185 deletions
+267
-185
common/scroll.js
common/scroll.js
+4
-3
slide/Drawing/DrawingDocument.js
slide/Drawing/DrawingDocument.js
+112
-34
slide/Drawing/HtmlPage.js
slide/Drawing/HtmlPage.js
+151
-148
No files found.
common/scroll.js
View file @
978f618a
...
...
@@ -1554,7 +1554,8 @@ function ScrollObject( elemID, settings, dbg ) {
arrowSizeW
:
13
,
arrowSizeH
:
13
,
cornerRadius
:
0
,
slimScroll
:
false
slimScroll
:
false
,
alwaysVisible
:
false
};
this
.
settings
=
extendSettings
(
settings
,
scrollSettings
);
...
...
@@ -1899,7 +1900,7 @@ ScrollObject.prototype = {
this
.
paneHeight
=
this
.
canvasH
-
this
.
arrowPosition
*
2
;
this
.
paneWidth
=
this
.
canvasW
-
this
.
arrowPosition
*
2
;
this
.
RecalcScroller
();
if
(
this
.
isVerticalScroll
)
{
if
(
this
.
isVerticalScroll
&&
!
this
.
settings
.
alwaysVisible
)
{
if
(
this
.
scrollVCurrentY
>
this
.
maxScrollY
)
this
.
scrollVCurrentY
=
this
.
maxScrollY
;
...
...
@@ -1918,7 +1919,7 @@ ScrollObject.prototype = {
this
.
scrollHCurrentX
=
this
.
maxScrollX
;
this
.
scrollToX
(
this
.
scrollHCurrentX
);
if
(
this
.
maxScrollX
==
0
){
if
(
this
.
maxScrollX
==
0
&&
!
this
.
settings
.
alwaysVisible
){
this
.
canvas
.
style
.
display
=
"
none
"
;
}
else
{
...
...
slide/Drawing/DrawingDocument.js
View file @
978f618a
...
...
@@ -3176,6 +3176,28 @@ function CDrawingDocument()
return
null
;
};
this
.
Notes_GetWidth
=
function
()
{
if
(
!
this
.
m_oWordControl
.
IsSupportNotes
)
return
0
;
if
(
!
this
.
m_oWordControl
.
m_oNotesApi
)
return
0
;
return
this
.
m_oWordControl
.
m_oNotesApi
.
GetNotesWidth
();
};
this
.
Notes_OnRecalculate
=
function
(
slideNum
,
width
,
height
)
{
if
(
!
this
.
m_oWordControl
.
IsSupportNotes
)
return
;
if
(
!
this
.
m_oWordControl
.
m_oNotesApi
)
return
;
this
.
m_oWordControl
.
m_oNotesApi
.
OnRecalculateNote
(
slideNum
,
width
,
height
);
};
}
function
CThPage
()
...
...
@@ -5149,6 +5171,7 @@ function CSlideDrawer()
this
.
CachedCanvasCtx
=
null
;
this
.
BoundsChecker
=
new
AscFormat
.
CSlideBoundsChecker
();
this
.
BoundsChecker2
=
new
AscFormat
.
CSlideBoundsChecker
();
this
.
CacheSlidePixW
=
1
;
this
.
CacheSlidePixH
=
1
;
...
...
@@ -5168,6 +5191,38 @@ function CSlideDrawer()
}
}
this
.
CheckSlideSize
=
function
(
zoom
,
slideNum
)
{
if
(
-
1
==
slideNum
)
this
.
bIsEmptyPresentation
=
true
;
var
dKoef
=
zoom
*
g_dKoef_mm_to_pix
/
100
;
if
(
this
.
m_oWordControl
.
bIsRetinaSupport
)
dKoef
*=
AscCommon
.
AscBrowser
.
retinaPixelRatio
;
var
w_mm
=
this
.
m_oWordControl
.
m_oLogicDocument
.
Width
;
var
h_mm
=
this
.
m_oWordControl
.
m_oLogicDocument
.
Height
;
var
w_px
=
(
w_mm
*
dKoef
)
>>
0
;
var
h_px
=
(
h_mm
*
dKoef
)
>>
0
;
this
.
BoundsChecker2
.
init
(
w_px
,
h_px
,
w_mm
,
h_mm
);
this
.
BoundsChecker2
.
transform
(
1
,
0
,
0
,
1
,
0
,
0
);
if
(
this
.
bIsEmptyPresentation
)
{
this
.
BoundsChecker2
.
_s
();
this
.
BoundsChecker2
.
_m
(
0
,
0
);
this
.
BoundsChecker2
.
_l
(
w_mm
,
0
);
this
.
BoundsChecker2
.
_l
(
w_mm
,
h_mm
);
this
.
BoundsChecker2
.
_l
(
0
,
h_mm
);
this
.
BoundsChecker2
.
_z
();
return
;
}
this
.
m_oWordControl
.
m_oLogicDocument
.
DrawPage
(
slideNum
,
this
.
BoundsChecker2
);
}
this
.
CheckSlide
=
function
(
slideNum
)
{
if
(
this
.
m_oWordControl
.
m_oApi
.
isSaveFonts_Images
)
...
...
@@ -5383,7 +5438,7 @@ function CSlideDrawer()
function
CNotesDrawer
(
page
)
{
this
.
Width
=
0
;
this
.
Width
=
0
;
this
.
Height
=
0
;
this
.
HtmlPage
=
page
;
...
...
@@ -5393,33 +5448,37 @@ function CNotesDrawer(page)
this
.
Slide
=
-
1
;
this
.
m_oOverlayApi
=
new
AscCommon
.
COverlay
();
this
.
m_oOverlayApi
.
m_oControl
=
this
.
HtmlPage
.
m_oNotesOverlay
;
this
.
m_oOverlayApi
.
m_oControl
=
this
.
HtmlPage
.
m_oNotesOverlay
;
this
.
m_oOverlayApi
.
m_oHtmlPage
=
this
.
HtmlPage
;
this
.
m_oOverlayApi
.
Clear
();
this
.
OffsetX
=
10
;
this
.
OffsetY
=
10
;
this
.
Scroll
=
0
;
this
.
ScrollMax
=
0
;
this
.
fontManager
=
new
AscFonts
.
CFontManager
();
this
.
fontManager
.
Initialize
(
true
);
this
.
fontManager
.
SetHintsProps
(
true
,
true
);
var
oThis
=
this
;
this
.
Init
=
function
()
this
.
Init
=
function
()
{
var
_elem
=
this
.
HtmlPage
.
m_oNotes
;
var
_elemOverlay
=
this
.
HtmlPage
.
m_oNotesOverlay
;
_elem
.
HtmlElement
.
onmousedown
=
this
.
onMouseDown
;
_elem
.
HtmlElement
.
onmousemove
=
this
.
onMouseMove
;
_elem
.
HtmlElement
.
onmouseup
=
this
.
onMouseUp
;
_elem
.
HtmlElement
.
onmouseup
=
this
.
onMouseUp
;
_elemOverlay
.
HtmlElement
.
onmousedown
=
this
.
onMouseDown
;
_elemOverlay
.
HtmlElement
.
onmousemove
=
this
.
onMouseMove
;
_elemOverlay
.
HtmlElement
.
onmouseup
=
this
.
onMouseUp
;
_elemOverlay
.
HtmlElement
.
onmouseup
=
this
.
onMouseUp
;
};
this
.
OnUpdateOverlay
=
function
()
this
.
OnUpdateOverlay
=
function
()
{
var
overlay
=
this
.
m_oOverlayApi
;
...
...
@@ -5434,7 +5493,7 @@ function CNotesDrawer(page)
var
ctx
=
overlay
.
m_oContext
;
if
(
drDoc
.
m_bIsSelection
)
{
ctx
.
fillStyle
=
"
rgba(51,102,204,255)
"
;
ctx
.
fillStyle
=
"
rgba(51,102,204,255)
"
;
ctx
.
strokeStyle
=
"
#9ADBFE
"
;
ctx
.
beginPath
();
...
...
@@ -5449,7 +5508,7 @@ function CNotesDrawer(page)
ctx
=
null
;
};
this
.
OnPaint
=
function
()
this
.
OnPaint
=
function
()
{
var
element
=
this
.
HtmlPage
.
m_oNotes
.
HtmlElement
;
var
ctx
=
element
.
getContext
(
'
2d
'
);
...
...
@@ -5458,7 +5517,7 @@ function CNotesDrawer(page)
if
(
-
1
==
this
.
Slide
)
return
;
var
dKoef
=
g_dKoef_mm_to_pix
/
100
;
var
dKoef
=
g_dKoef_mm_to_pix
;
if
(
this
.
HtmlPage
.
bIsRetinaSupport
)
dKoef
*=
AscCommon
.
AscBrowser
.
retinaPixelRatio
;
...
...
@@ -5475,16 +5534,17 @@ function CNotesDrawer(page)
g
.
IsRetina
=
true
;
g
.
m_oCoordTransform
.
tx
=
this
.
OffsetX
;
g
.
m_oCoordTransform
.
ty
=
this
.
OffsetY
;
g
.
m_oCoordTransform
.
ty
=
-
this
.
Scroll
;
g
.
transform
(
1
,
0
,
0
,
1
,
0
,
0
);
g
.
IsNoDrawingEmptyPlaceholder
=
true
;
g
.
IsNoDrawingEmptyPlaceholderText
=
true
;
this
.
HtmlPage
.
m_oLogicDocument
.
DrawNote
(
this
.
Slide
,
g
);
this
.
HtmlPage
.
m_oLogicDocument
.
Notes_Draw
(
this
.
Slide
,
g
);
this
.
IsRepaint
=
false
;
};
this
.
OnRecalculateNote
=
function
(
slideNum
,
width
,
height
)
this
.
OnRecalculateNote
=
function
(
slideNum
,
width
,
height
)
{
this
.
Slide
=
slideNum
;
this
.
Width
=
width
;
...
...
@@ -5496,17 +5556,17 @@ function CNotesDrawer(page)
var
element
=
this
.
HtmlPage
.
m_oNotes
.
HtmlElement
;
var
settings
=
{
showArrows
:
true
,
animateScroll
:
false
,
screenW
:
element
.
width
,
screenH
:
element
.
height
,
screenAddW
:
0
,
screenAddH
:
0
,
vsscrollStep
:
45
,
hsscrollStep
:
45
,
contentW
:
2
*
this
.
OffsetX
+
((
width
*
g_dKoef_mm_to_pix
)
>>
0
)
,
contentH
:
2
*
this
.
OffsetY
+
((
height
*
g_dKoef_mm_to_pix
)
>>
0
),
scrollerMinHeight
:
5
showArrows
:
true
,
animateScroll
:
false
,
screenW
:
element
.
width
,
screenH
:
element
.
height
,
screenAddW
:
0
,
screenAddH
:
0
,
vsscrollStep
:
45
,
hsscrollStep
:
45
,
contentW
:
1
,
contentH
:
2
*
this
.
OffsetY
+
((
height
*
g_dKoef_mm_to_pix
)
>>
0
),
scrollerMinHeight
:
5
};
if
(
this
.
bIsRetinaSupport
)
...
...
@@ -5517,6 +5577,9 @@ function CNotesDrawer(page)
settings
.
screenAddH
=
AscCommon
.
AscBrowser
.
convertToRetinaValue
(
settings
.
screenAddH
);
}
this
.
Scroll
=
0
;
this
.
ScrollMax
=
Math
.
max
(
0
,
settings
.
contentH
-
settings
.
screenH
);
document
.
getElementById
(
'
panel_right_scroll_notes
'
).
style
.
height
=
settings
.
contentH
+
"
px
"
;
if
(
this
.
HtmlPage
.
m_oScrollNotes_
)
...
...
@@ -5527,30 +5590,31 @@ function CNotesDrawer(page)
{
this
.
HtmlPage
.
m_oScrollNotes_
=
new
AscCommon
.
ScrollObject
(
"
id_vertical_scroll_notes
"
,
settings
);
this
.
HtmlPage
.
m_oScrollNotes_
.
onLockMouse
=
function
(
evt
)
this
.
HtmlPage
.
m_oScrollNotes_
.
onLockMouse
=
function
(
evt
)
{
AscCommon
.
check_MouseDownEvent
(
evt
,
true
);
global_mouseEvent
.
LockMouse
();
};
this
.
HtmlPage
.
m_oScrollNotes_
.
offLockMouse
=
function
(
evt
)
this
.
HtmlPage
.
m_oScrollNotes_
.
offLockMouse
=
function
(
evt
)
{
AscCommon
.
check_MouseUpEvent
(
evt
);
};
this
.
HtmlPage
.
m_oScrollNotes_
.
bind
(
"
scrollvertical
"
,
function
(
evt
)
this
.
HtmlPage
.
m_oScrollNotes_
.
bind
(
"
scrollvertical
"
,
function
(
evt
)
{
// TODO:
oThis
.
Scroll
=
(
oThis
.
ScrollMax
*
evt
.
scrollD
/
Math
.
max
(
evt
.
maxScrollY
,
1
))
>>
0
;
oThis
.
IsRepaint
=
true
;
});
}
};
this
.
CheckPaint
=
function
()
this
.
CheckPaint
=
function
()
{
if
(
this
.
IsRepaint
)
this
.
OnPaint
();
};
this
.
onMouseDown
=
function
(
e
)
this
.
onMouseDown
=
function
(
e
)
{
AscCommon
.
check_MouseDownEvent
(
e
,
true
);
global_mouseEvent
.
LockMouse
();
...
...
@@ -5562,11 +5626,11 @@ function CNotesDrawer(page)
console
.
log
(
_x
+
"
,
"
+
_y
);
};
this
.
onMouseMove
=
function
(
e
)
this
.
onMouseMove
=
function
(
e
)
{
AscCommon
.
check_MouseMoveEvent
(
e
);
};
this
.
onMouseUp
=
function
(
e
)
this
.
onMouseUp
=
function
(
e
)
{
AscCommon
.
check_MouseUpEvent
(
e
);
...
...
@@ -5576,14 +5640,28 @@ function CNotesDrawer(page)
console
.
log
(
_x
+
"
,
"
+
_y
);
};
this
.
onUpdateTarget
=
function
()
this
.
onUpdateTarget
=
function
()
{
};
this
.
OnResize
=
function
()
this
.
OnResize
=
function
()
{
if
(
this
.
HtmlPage
.
m_oLogicDocument
)
{
if
(
!
this
.
HtmlPage
.
m_oLogicDocument
.
Notes_OnResize
())
{
this
.
OnRecalculateNote
(
this
.
Slide
,
this
.
Width
,
this
.
Height
);
}
}
};
this
.
GetNotesWidth
=
function
()
{
this
.
OnRecalculateNote
(
this
.
Slide
,
this
.
Width
,
this
.
Height
);
var
_pix_width
=
this
.
HtmlPage
.
m_oNotes
.
HtmlElement
.
width
-
20
;
if
(
_pix_width
<
10
)
_pix_width
=
10
;
return
_pix_width
/
g_dKoef_mm_to_pix
;
};
}
...
...
slide/Drawing/HtmlPage.js
View file @
978f618a
...
...
@@ -196,7 +196,6 @@ function CEditorPage(api)
// properties
this
.
m_bIsHorScrollVisible
=
false
;
this
.
m_bIsCheckHeedHorScrollRepeat
=
false
;
this
.
m_bIsRuler
=
false
;
this
.
m_bDocumentPlaceChangedEnabled
=
false
;
...
...
@@ -847,13 +846,11 @@ function CEditorPage(api)
oThis
.
OnResize
(
true
);
};
this
.
zoom_FitToWidth
=
function
()
this
.
zoom_FitToWidth
_value
=
function
()
{
if
(
null
==
this
.
m_oLogicDocument
)
{
this
.
m_nZoomType
=
1
;
return
;
}
var
_value
=
100
;
if
(
!
this
.
m_oLogicDocument
)
return
_value
;
var
w
=
this
.
m_oEditor
.
HtmlElement
.
width
;
if
(
this
.
bIsRetinaSupport
)
...
...
@@ -868,34 +865,23 @@ function CEditorPage(api)
if
(
Zoom
<
5
)
Zoom
=
5
;
}
var
_new_value
=
Zoom
>>
0
;
this
.
m_nZoomType
=
1
;
if
(
_new_value
!=
this
.
m_nZoomValue
)
{
this
.
m_nZoomValue
=
_new_value
;
this
.
zoom_Fire
(
1
);
return
true
;
}
else
{
this
.
m_oApi
.
sync_zoomChangeCallback
(
this
.
m_nZoomValue
,
1
);
}
return
false
;
_value
=
Zoom
>>
0
;
return
_value
;
};
this
.
zoom_FitToPage
=
function
(
)
this
.
zoom_FitToPage
_value
=
function
(
_canvas_height
)
{
if
(
null
==
this
.
m_oLogicDocument
)
{
this
.
m_nZoomType
=
2
;
return
;
}
var
_value
=
100
;
if
(
!
this
.
m_oLogicDocument
)
return
_value
;
var
w
=
this
.
m_oEditor
.
HtmlElement
.
width
;
var
h
=
(
undefined
==
_canvas_height
)
?
this
.
m_oEditor
.
HtmlElement
.
height
:
_canvas_height
;
if
(
this
.
bIsRetinaSupport
)
{
w
/=
AscCommon
.
AscBrowser
.
retinaPixelRatio
;
var
h
=
((
this
.
m_oMainView
.
AbsolutePosition
.
B
-
this
.
m_oMainView
.
AbsolutePosition
.
T
)
*
g_dKoef_mm_to_pix
)
>>
0
;
h
/=
AscCommon
.
AscBrowser
.
retinaPixelRatio
;
}
var
_pageWidth
=
this
.
m_oLogicDocument
.
Width
*
g_dKoef_mm_to_pix
;
var
_pageHeight
=
this
.
m_oLogicDocument
.
Height
*
g_dKoef_mm_to_pix
;
...
...
@@ -907,12 +893,42 @@ function CEditorPage(api)
if
(
0
!=
_pageHeight
)
_ver_Zoom
=
(
100
*
(
h
-
2
*
this
.
SlideDrawer
.
CONST_BORDER
))
/
_pageHeight
;
var
_new_value
=
(
Math
.
min
(
_hor_Zoom
,
_ver_Zoom
)
-
0.5
)
>>
0
;
_value
=
(
Math
.
min
(
_hor_Zoom
,
_ver_Zoom
)
-
0.5
)
>>
0
;
if
(
_value
<
5
)
_value
=
5
;
if
(
_new_value
<
5
)
_new_value
=
5
;
return
_value
;
}
;
this
.
zoom_FitToWidth
=
function
()
{
this
.
m_nZoomType
=
1
;
if
(
!
this
.
m_oLogicDocument
)
return
;
var
_new_value
=
this
.
zoom_FitToWidth_value
();
if
(
_new_value
!=
this
.
m_nZoomValue
)
{
this
.
m_nZoomValue
=
_new_value
;
this
.
zoom_Fire
(
1
);
return
true
;
}
else
{
this
.
m_oApi
.
sync_zoomChangeCallback
(
this
.
m_nZoomValue
,
1
);
}
return
false
;
};
this
.
zoom_FitToPage
=
function
()
{
this
.
m_nZoomType
=
2
;
if
(
!
this
.
m_oLogicDocument
)
return
;
var
_new_value
=
this
.
zoom_FitToPage_value
();
if
(
_new_value
!=
this
.
m_nZoomValue
)
{
this
.
m_nZoomValue
=
_new_value
;
...
...
@@ -2370,6 +2386,7 @@ function CEditorPage(api)
if
(
this
.
m_bIsHorScrollVisible
)
{
settings
.
alwaysVisible
=
true
;
if
(
this
.
m_oScrollHor_
)
this
.
m_oScrollHor_
.
Repos
(
settings
,
true
,
undefined
);
//unbind("scrollhorizontal")
else
...
...
@@ -2392,6 +2409,7 @@ function CEditorPage(api)
this
.
m_oScrollHorApi
=
this
.
m_oScrollHor_
;
}
settings
.
alwaysVisible
=
undefined
;
}
if
(
this
.
m_oScrollVer_
)
...
...
@@ -2483,7 +2501,9 @@ function CEditorPage(api)
this
.
DemonstrationManager
.
Resize
();
if
(
this
.
checkNeedHorScroll
())
{
return
;
}
// теперь проверим необходимость перезуммирования
if
(
1
==
this
.
m_nZoomType
&&
0
!=
this
.
m_dDocumentPageWidth
&&
0
!=
this
.
m_dDocumentPageHeight
)
...
...
@@ -2544,7 +2564,9 @@ function CEditorPage(api)
this
.
DemonstrationManager
.
Resize
();
if
(
this
.
checkNeedHorScroll
())
{
return
;
}
// теперь проверим необходимость перезуммирования
if
(
1
==
this
.
m_nZoomType
)
...
...
@@ -2607,20 +2629,46 @@ function CEditorPage(api)
this
.
m_oMainView
.
Bounds
.
T
=
0
;
}
};
this
.
checkNeedHorScroll
=
function
()
this
.
checkNeedHorScrollValue
=
function
(
_width
)
{
var
w
=
this
.
m_oEditor
.
HtmlElement
.
width
;
if
(
this
.
bIsRetinaSupport
)
w
/=
AscCommon
.
AscBrowser
.
retinaPixelRatio
;
return
(
_width
<=
w
)
?
false
:
true
;
};
this
.
checkNeedHorScroll
=
function
()
{
if
(
!
this
.
m_oLogicDocument
)
return
false
;
var
oldVisible
=
this
.
m_bIsHorScrollVisible
;
if
(
this
.
m_dDocumentWidth
<=
w
)
if
(
this
.
m_nZoomType
==
0
||
this
.
m_nZoomType
==
1
)
{
this
.
m_bIsHorScrollVisible
=
false
;
this
.
m_bIsHorScrollVisible
=
this
.
checkNeedHorScrollValue
(
this
.
m_dDocumentWidth
)
;
}
else
{
this
.
m_bIsHorScrollVisible
=
true
;
var
canvas_height1
=
this
.
m_oEditor
.
HtmlElement
.
height
;
var
addition
=
AscCommon
.
AscBrowser
.
convertToRetinaValue
(
this
.
ScrollWidthPx
,
true
);
var
canvas_height2
=
this
.
m_bIsHorScrollVisible
?
(
canvas_height1
+
addition
)
:
(
canvas_height1
-
addition
);
var
zoom1
=
this
.
zoom_FitToPage_value
(
canvas_height1
);
var
zoom2
=
this
.
zoom_FitToPage_value
(
canvas_height2
);
var
size1
=
this
.
CalculateDocumentSizeInternal
(
canvas_height1
,
zoom1
,
true
);
var
size2
=
this
.
CalculateDocumentSizeInternal
(
canvas_height2
,
zoom2
,
true
);
var
needScroll1
=
this
.
checkNeedHorScrollValue
(
size1
.
m_dDocumentWidth
);
var
needScroll2
=
this
.
checkNeedHorScrollValue
(
size2
.
m_dDocumentWidth
);
if
(
needScroll1
==
needScroll2
)
this
.
m_bIsHorScrollVisible
=
needScroll1
;
else
this
.
m_bIsHorScrollVisible
=
true
;
}
var
hor_scroll
=
document
.
getElementById
(
'
panel_hor_scroll
'
);
...
...
@@ -2643,27 +2691,17 @@ function CEditorPage(api)
}
else
{
if
(
this
.
m_bIsCheckHeedHorScrollRepeat
&&
oldVisible
==
true
)
{
this
.
m_bIsHorScrollVisible
=
true
;
this
.
m_dScrollX
=
0
;
}
else
{
this
.
m_oPanelRight
.
Bounds
.
B
=
0
;
this
.
m_oMainView
.
Bounds
.
B
=
0
;
this
.
m_oScrollHor
.
HtmlElement
.
style
.
display
=
'
none
'
;
}
this
.
m_oPanelRight
.
Bounds
.
B
=
0
;
this
.
m_oMainView
.
Bounds
.
B
=
0
;
this
.
m_oScrollHor
.
HtmlElement
.
style
.
display
=
'
none
'
;
}
if
(
this
.
m_bIsHorScrollVisible
!=
oldVisible
)
{
this
.
m_bIsCheckHeedHorScrollRepeat
=
true
;
this
.
m_dScrollX
=
0
;
this
.
OnResize
(
true
);
return
true
;
}
this
.
m_bIsCheckHeedHorScrollRepeat
=
false
;
return
false
;
};
...
...
@@ -2932,26 +2970,34 @@ function CEditorPage(api)
this
.
m_oDrawingDocument
.
ClearCachePages
();
};
this
.
CalculateDocumentSize
=
function
(
bIsAttack
)
this
.
CalculateDocumentSize
Internal
=
function
(
_canvas_height
,
_zoom_value
,
_check_bounds2
)
{
if
(
false
===
oThis
.
m_oApi
.
bInit_word_control
)
{
oThis
.
UpdateScrolls
();
return
;
}
this
.
m_dDocumentWidth
=
0
;
this
.
m_dDocumentHeight
=
0
;
this
.
m_dDocumentPageWidth
=
0
;
this
.
m_dDocumentPageHeight
=
0
;
var
size
=
{
m_dDocumentWidth
:
0
,
m_dDocumentHeight
:
0
,
m_dDocumentPageWidth
:
0
,
m_dDocumentPageHeight
:
0
,
SlideScrollMIN
:
0
,
SlideScrollMAX
:
0
};
var
dKoef
=
(
this
.
m_nZoomValue
*
g_dKoef_mm_to_pix
/
100
);
var
_zoom
=
(
undefined
==
_zoom_value
)
?
this
.
m_nZoomValue
:
_zoom_value
;
var
dKoef
=
(
_zoom
*
g_dKoef_mm_to_pix
/
100
);
this
.
SlideBoundsOnCalculateSize
.
fromBounds
(
this
.
SlideDrawer
.
BoundsChecker
.
Bounds
);
var
_bounds_slide
=
this
.
SlideBoundsOnCalculateSize
;
if
(
undefined
==
_check_bounds2
)
{
this
.
SlideBoundsOnCalculateSize
.
fromBounds
(
this
.
SlideDrawer
.
BoundsChecker
.
Bounds
);
}
else
{
_bounds_slide
=
new
AscFormat
.
CBoundsController
();
this
.
SlideDrawer
.
CheckSlideSize
(
_zoom
,
this
.
m_oDrawingDocument
.
SlideCurrent
);
_bounds_slide
.
fromBounds
(
this
.
SlideDrawer
.
BoundsChecker2
.
Bounds
);
}
var
_srcW
=
this
.
m_oEditor
.
HtmlElement
.
width
;
var
_srcH
=
this
.
m_oEditor
.
HtmlElement
.
height
;
var
_srcH
=
(
undefined
!==
_canvas_height
)
?
_canvas_height
:
this
.
m_oEditor
.
HtmlElement
.
height
;
if
(
this
.
bIsRetinaSupport
)
{
_srcW
=
(
_srcW
/
AscCommon
.
AscBrowser
.
retinaPixelRatio
)
>>
0
;
...
...
@@ -2981,38 +3027,48 @@ function CEditorPage(api)
var
one_slide_width
=
lWSlide
;
var
one_slide_height
=
Math
.
max
(
lHSlide
,
_srcH
);
this
.
m_dDocumentPageWidth
=
one_slide_width
;
this
.
m_dDocumentPageHeight
=
one_slide_height
;
size
.
m_dDocumentPageWidth
=
one_slide_width
;
size
.
m_dDocumentPageHeight
=
one_slide_height
;
this
.
m_dDocumentWidth
=
one_slide_width
;
this
.
m_dDocumentHeight
=
(
one_slide_height
*
this
.
m_oDrawingDocument
.
SlidesCount
)
>>
0
;
size
.
m_dDocumentWidth
=
one_slide_width
;
size
.
m_dDocumentHeight
=
(
one_slide_height
*
this
.
m_oDrawingDocument
.
SlidesCount
)
>>
0
;
if
(
0
==
this
.
m_oDrawingDocument
.
SlidesCount
)
this
.
m_dDocumentHeight
=
one_slide_height
>>
0
;
size
.
m_dDocumentHeight
=
one_slide_height
>>
0
;
size
.
SlideScrollMIN
=
this
.
m_oDrawingDocument
.
SlideCurrent
*
one_slide_height
;
size
.
SlideScrollMAX
=
size
.
SlideScrollMIN
+
one_slide_height
-
_srcH
;
if
(
!
bIsAttack
&&
this
.
OldDocumentWidth
==
this
.
m_dDocumentWidth
&&
this
.
OldDocumentHeight
==
this
.
m_dDocumentHeigh
t
)
if
(
0
==
this
.
m_oDrawingDocument
.
SlidesCoun
t
)
{
/*
this.Thumbnails.SlideWidth = this.m_oLogicDocument.Width;
this.Thumbnails.SlideHeight = this.m_oLogicDocument.Height;
this.Thumbnails.SlidesCount = this.m_oDrawingDocument.SlidesCount;
this.Thumbnails.CheckSizes();
return;
*/
size
.
SlideScrollMIN
=
0
;
size
.
SlideScrollMAX
=
size
.
SlideScrollMIN
+
one_slide_height
-
_srcH
;
}
this
.
OldDocumentWidth
=
this
.
m_dDocumentWidth
;
this
.
OldDocumentHeight
=
this
.
m_dDocumentHeight
;
this
.
SlideScrollMIN
=
this
.
m_oDrawingDocument
.
SlideCurrent
*
one_slide_height
;
this
.
SlideScrollMAX
=
this
.
SlideScrollMIN
+
one_slide_height
-
_srcH
;
return
size
;
};
if
(
0
==
this
.
m_oDrawingDocument
.
SlidesCount
)
this
.
CalculateDocumentSize
=
function
(
bIsAttack
)
{
if
(
false
===
oThis
.
m_oApi
.
bInit_word_control
)
{
this
.
SlideScrollMIN
=
0
;
this
.
SlideScrollMAX
=
this
.
SlideScrollMIN
+
one_slide_height
-
_srcH
;
oThis
.
UpdateScrolls
()
;
return
;
}
var
size
=
this
.
CalculateDocumentSizeInternal
();
this
.
m_dDocumentWidth
=
size
.
m_dDocumentWidth
;
this
.
m_dDocumentHeight
=
size
.
m_dDocumentHeight
;
this
.
m_dDocumentPageWidth
=
size
.
m_dDocumentPageWidth
;
this
.
m_dDocumentPageHeight
=
size
.
m_dDocumentPageHeight
;
this
.
OldDocumentWidth
=
this
.
m_dDocumentWidth
;
this
.
OldDocumentHeight
=
this
.
m_dDocumentHeight
;
this
.
SlideScrollMIN
=
size
.
SlideScrollMIN
;
this
.
SlideScrollMAX
=
size
.
SlideScrollMAX
;
// теперь проверим необходимость перезуммирования
if
(
1
==
this
.
m_nZoomType
)
{
...
...
@@ -3052,75 +3108,18 @@ function CEditorPage(api)
return
;
}
if
((
Math
.
abs
(
_bounds
.
min_x
-
this
.
SlideBoundsOnCalculateSize
.
min_x
)
<
0.1
)
&&
(
Math
.
abs
(
_bounds
.
min_y
-
this
.
SlideBoundsOnCalculateSize
.
min_y
)
<
0.1
)
&&
(
Math
.
abs
(
_bounds
.
max_x
-
this
.
SlideBoundsOnCalculateSize
.
max_x
)
<
0.1
)
&&
(
Math
.
abs
(
_bounds
.
max_y
-
this
.
SlideBoundsOnCalculateSize
.
max_y
)
<
0.1
))
{
return
;
}
var
size
=
this
.
CalculateDocumentSizeInternal
();
this
.
m_dDocumentWidth
=
0
;
this
.
m_dDocumentHeight
=
0
;
this
.
m_dDocumentPageWidth
=
0
;
this
.
m_dDocumentPageHeight
=
0
;
var
dKoef
=
(
this
.
m_nZoomValue
*
g_dKoef_mm_to_pix
/
100
);
this
.
SlideBoundsOnCalculateSize
.
fromBounds
(
_bounds
);
var
_bounds_slide
=
this
.
SlideBoundsOnCalculateSize
;
var
_srcW
=
this
.
m_oEditor
.
HtmlElement
.
width
;
var
_srcH
=
this
.
m_oEditor
.
HtmlElement
.
height
;
if
(
this
.
bIsRetinaSupport
)
{
_srcW
=
(
_srcW
/
AscCommon
.
AscBrowser
.
retinaPixelRatio
)
>>
0
;
_srcH
=
(
_srcH
/
AscCommon
.
AscBrowser
.
retinaPixelRatio
)
>>
0
;
_bounds_slide
=
{
min_x
:
(
_bounds_slide
.
min_x
/
AscCommon
.
AscBrowser
.
retinaPixelRatio
)
>>
0
,
min_y
:
(
_bounds_slide
.
min_y
/
AscCommon
.
AscBrowser
.
retinaPixelRatio
)
>>
0
,
max_x
:
(
_bounds_slide
.
max_x
/
AscCommon
.
AscBrowser
.
retinaPixelRatio
)
>>
0
,
max_y
:
(
_bounds_slide
.
max_y
/
AscCommon
.
AscBrowser
.
retinaPixelRatio
)
>>
0
};
}
var
_centerX
=
(
_srcW
/
2
)
>>
0
;
var
_centerSlideX
=
(
dKoef
*
this
.
m_oLogicDocument
.
Width
/
2
)
>>
0
;
var
_hor_width_left
=
Math
.
min
(
0
,
_centerX
-
(
_centerSlideX
-
_bounds_slide
.
min_x
)
-
this
.
SlideDrawer
.
CONST_BORDER
);
var
_hor_width_right
=
Math
.
max
(
_srcW
-
1
,
_centerX
+
(
_bounds_slide
.
max_x
-
_centerSlideX
)
+
this
.
SlideDrawer
.
CONST_BORDER
);
var
_centerY
=
(
_srcH
/
2
)
>>
0
;
var
_centerSlideY
=
(
dKoef
*
this
.
m_oLogicDocument
.
Height
/
2
)
>>
0
;
var
_ver_height_top
=
Math
.
min
(
0
,
_centerY
-
(
_centerSlideY
-
_bounds_slide
.
min_y
)
-
this
.
SlideDrawer
.
CONST_BORDER
);
var
_ver_height_bottom
=
Math
.
max
(
_srcH
-
1
,
_centerY
+
(
_bounds_slide
.
max_y
-
_centerSlideY
)
+
this
.
SlideDrawer
.
CONST_BORDER
);
var
lWSlide
=
_hor_width_right
-
_hor_width_left
+
1
;
var
lHSlide
=
_ver_height_bottom
-
_ver_height_top
+
1
;
var
one_slide_width
=
lWSlide
;
var
one_slide_height
=
Math
.
max
(
lHSlide
,
_srcH
);
this
.
m_dDocumentPageWidth
=
one_slide_width
;
this
.
m_dDocumentPageHeight
=
one_slide_height
;
this
.
m_dDocumentWidth
=
one_slide_width
;
this
.
m_dDocumentHeight
=
(
one_slide_height
*
this
.
m_oDrawingDocument
.
SlidesCount
)
>>
0
;
if
(
0
==
this
.
m_oDrawingDocument
.
SlidesCount
)
this
.
m_dDocumentHeight
=
one_slide_height
>>
0
;
this
.
m_dDocumentWidth
=
size
.
m_dDocumentWidth
;
this
.
m_dDocumentHeight
=
size
.
m_dDocumentHeight
;
this
.
m_dDocumentPageWidth
=
size
.
m_dDocumentPageWidth
;
this
.
m_dDocumentPageHeight
=
size
.
m_dDocumentPageHeight
;
this
.
OldDocumentWidth
=
this
.
m_dDocumentWidth
;
this
.
OldDocumentHeight
=
this
.
m_dDocumentHeight
;
this
.
SlideScrollMIN
=
this
.
m_oDrawingDocument
.
SlideCurrent
*
one_slide_height
;
this
.
SlideScrollMAX
=
this
.
SlideScrollMIN
+
one_slide_height
-
_srcH
;
if
(
0
==
this
.
m_oDrawingDocument
.
SlidesCount
)
{
this
.
SlideScrollMIN
=
0
;
this
.
SlideScrollMAX
=
this
.
SlideScrollMIN
+
one_slide_height
-
_srcH
;
}
this
.
SlideScrollMIN
=
size
.
SlideScrollMIN
;
this
.
SlideScrollMAX
=
size
.
SlideScrollMAX
;
this
.
MainScrollLock
();
...
...
@@ -3210,6 +3209,10 @@ function CEditorPage(api)
{
oWordControl
.
Thumbnails
.
onCheckUpdate
();
}
if
(
oWordControl
.
IsSupportNotes
&&
oWordControl
.
m_oNotesApi
)
oWordControl
.
m_oNotesApi
.
CheckPaint
();
if
(
null
!=
oWordControl
.
m_oLogicDocument
)
{
oWordControl
.
m_oDrawingDocument
.
UpdateTargetFromPaint
=
true
;
...
...
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