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
13d08417
Commit
13d08417
authored
Nov 08, 2016
by
Alexander.Trofimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
getDrawingAreaMetrics -> getMaxColRow
parent
50e955f7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
34 deletions
+21
-34
cell/view/WorksheetView.js
cell/view/WorksheetView.js
+14
-15
common/Charts/DrawingObjects.js
common/Charts/DrawingObjects.js
+7
-19
No files found.
cell/view/WorksheetView.js
View file @
13d08417
...
...
@@ -1379,8 +1379,8 @@
WorksheetView
.
prototype
.
_calcWidthColumns
=
function
(
fullRecalc
)
{
var
x
=
this
.
cellsLeft
;
var
visibleW
=
this
.
drawingCtx
.
getWidth
();
var
obr
=
this
.
objectRender
?
this
.
objectRender
.
getDrawingAreaMetrics
()
:
{
maxCol
:
0
,
maxRow
:
0
}
;
var
l
=
Math
.
max
(
this
.
model
.
getColsCount
()
+
1
,
this
.
nColsCount
,
obr
.
maxCol
);
var
maxColObjects
=
this
.
objectRender
?
this
.
objectRender
.
getMaxColRow
().
col
:
-
1
;
var
l
=
Math
.
max
(
this
.
model
.
getColsCount
()
+
1
,
this
.
nColsCount
,
maxColObjects
);
var
i
=
0
,
w
,
column
,
isBestFit
,
hiddenW
=
0
;
// Берем дефалтовую ширину документа
...
...
@@ -1423,8 +1423,8 @@
WorksheetView
.
prototype
.
_calcHeightRows
=
function
(
fullRecalc
)
{
var
y
=
this
.
cellsTop
;
var
visibleH
=
this
.
drawingCtx
.
getHeight
();
var
obr
=
this
.
objectRender
?
this
.
objectRender
.
getDrawingAreaMetrics
()
:
{
maxCol
:
0
,
maxRow
:
0
}
;
var
l
=
Math
.
max
(
this
.
model
.
getRowsCount
()
+
1
,
this
.
nRowsCount
,
obr
.
maxRow
);
var
maxRowObjects
=
this
.
objectRender
?
this
.
objectRender
.
getMaxColRow
().
row
:
-
1
;
var
l
=
Math
.
max
(
this
.
model
.
getRowsCount
()
+
1
,
this
.
nRowsCount
,
maxRowObjects
);
var
defaultH
=
this
.
defaultRowHeight
;
var
i
=
0
,
h
,
hR
,
isCustomHeight
,
row
,
hiddenH
=
0
;
...
...
@@ -1701,11 +1701,10 @@
maxRows
=
lastR
+
1
;
// Получаем максимальную колонку/строку для изображений/чатов
maxCell
=
this
.
objectRender
.
getDrawingAreaMetrics
();
if
(
maxCell
)
{
maxCols
=
Math
.
max
(
maxCols
,
maxCell
.
maxCol
);
maxRows
=
Math
.
max
(
maxRows
,
maxCell
.
maxRow
);
}
maxCell
=
this
.
objectRender
.
getMaxColRow
();
maxCols
=
Math
.
max
(
maxCols
,
maxCell
.
col
);
maxRows
=
Math
.
max
(
maxRows
,
maxCell
.
row
);
}
else
{
maxCols
=
selectionRange
.
c2
+
1
;
maxRows
=
selectionRange
.
r2
+
1
;
...
...
@@ -5308,7 +5307,7 @@
}
function
findEOT
()
{
var
obr
=
t
.
objectRender
?
t
.
objectRender
.
get
DrawingAreaMetrics
()
:
{
maxCol
:
0
,
maxRow
:
0
}
;
var
obr
=
t
.
objectRender
?
t
.
objectRender
.
get
MaxColRow
()
:
new
AscCommon
.
CellBase
(
-
1
,
-
1
)
;
var
maxCols
=
t
.
model
.
getColsCount
();
var
maxRows
=
t
.
model
.
getRowsCount
();
var
lastC
=
-
1
,
lastR
=
-
1
;
...
...
@@ -5321,7 +5320,7 @@
}
}
}
return
{
col
:
Math
.
max
(
lastC
,
obr
.
maxCol
),
row
:
Math
.
max
(
lastR
,
obr
.
maxR
ow
)};
return
{
col
:
Math
.
max
(
lastC
,
obr
.
col
),
row
:
Math
.
max
(
lastR
,
obr
.
r
ow
)};
}
var
eot
=
dc
>
+
2.0001
&&
dc
<
+
2.9999
&&
dr
>
+
2.0001
&&
dr
<
+
2.9999
?
findEOT
()
:
null
;
...
...
@@ -10166,8 +10165,8 @@
};
WorksheetView
.
prototype
.
expandColsOnScroll
=
function
(
isNotActive
,
updateColsCount
,
newColsCount
)
{
var
obr
=
this
.
objectRender
?
this
.
objectRender
.
getDrawingAreaMetrics
()
:
{
maxCol
:
0
,
maxRow
:
0
}
;
var
maxc
=
Math
.
max
(
this
.
model
.
getColsCount
()
+
1
,
this
.
cols
.
length
,
obr
.
maxCol
);
var
maxColObjects
=
this
.
objectRender
?
this
.
objectRender
.
getMaxColRow
().
col
:
-
1
;
var
maxc
=
Math
.
max
(
this
.
model
.
getColsCount
()
+
1
,
this
.
cols
.
length
,
maxColObjects
);
if
(
newColsCount
)
{
maxc
=
Math
.
max
(
maxc
,
newColsCount
);
}
...
...
@@ -10197,8 +10196,8 @@
};
WorksheetView
.
prototype
.
expandRowsOnScroll
=
function
(
isNotActive
,
updateRowsCount
,
newRowsCount
)
{
var
obr
=
this
.
objectRender
?
this
.
objectRender
.
getDrawingAreaMetrics
()
:
{
maxCol
:
0
,
maxRow
:
0
}
;
var
maxr
=
Math
.
max
(
this
.
model
.
getRowsCount
()
+
1
,
this
.
rows
.
length
,
obr
.
maxRow
);
var
maxRowObjects
=
this
.
objectRender
?
this
.
objectRender
.
getMaxColRow
().
row
:
-
1
;
var
maxr
=
Math
.
max
(
this
.
model
.
getRowsCount
()
+
1
,
this
.
rows
.
length
,
maxRowObjects
);
if
(
newRowsCount
)
{
maxr
=
Math
.
max
(
maxr
,
newRowsCount
);
}
...
...
common/Charts/DrawingObjects.js
View file @
13d08417
...
...
@@ -2189,26 +2189,14 @@ function DrawingObjects() {
}
};
_this
.
getDrawingAreaMetrics
=
function
()
{
/*
* Объект, определяющий max колонку и строчку для отрисовки объектов листа
*/
var
metrics
=
{
maxCol
:
0
,
maxRow
:
0
};
for
(
var
i
=
0
;
aObjects
&&
(
i
<
aObjects
.
length
);
i
++
)
{
_this
.
getMaxColRow
=
function
()
{
var
r
=
-
1
,
c
=
-
1
;
aObjects
.
forEach
(
function
(
item
)
{
r
=
Math
.
max
(
r
,
item
.
to
.
row
+
1
);
c
=
Math
.
max
(
c
,
item
.
to
.
col
+
1
);
});
var
drawingObject
=
aObjects
[
i
];
if
(
drawingObject
.
to
.
col
>=
metrics
.
maxCol
)
metrics
.
maxCol
=
drawingObject
.
to
.
col
+
1
;
// учитываем colOff
if
(
drawingObject
.
to
.
row
>=
metrics
.
maxRow
)
metrics
.
maxRow
=
drawingObject
.
to
.
row
+
1
;
// учитываем rowOff
}
return
metrics
;
return
new
AscCommon
.
CellBase
(
r
,
c
);
};
_this
.
clipGraphicsCanvas
=
function
(
canvas
,
graphicOption
)
{
...
...
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