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
6743f584
Commit
6743f584
authored
Mar 30, 2016
by
Alexander.Trofimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Убрал $.extend, перешел на []
Добавил прототип drawSparklines
parent
0cac3da6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
11 deletions
+20
-11
cell/view/WorksheetView.js
cell/view/WorksheetView.js
+20
-11
No files found.
cell/view/WorksheetView.js
View file @
6743f584
...
@@ -2437,19 +2437,28 @@
...
@@ -2437,19 +2437,28 @@
}
}
};
};
/** Рисует спарклайны */
WorksheetView
.
prototype
.
_drawSparklines
=
function
(
drawingCtx
,
range
,
offsetX
,
offsetY
)
{
};
/** Рисует ячейки таблицы */
/** Рисует ячейки таблицы */
WorksheetView
.
prototype
.
_drawCells
=
function
(
drawingCtx
,
range
,
offsetX
,
offsetY
)
{
WorksheetView
.
prototype
.
_drawCells
=
function
(
drawingCtx
,
range
,
offsetX
,
offsetY
)
{
this
.
_prepareCellTextMetricsCache
(
range
);
this
.
_prepareCellTextMetricsCache
(
range
);
var
mergedCells
=
{}
,
mc
,
i
;
var
mergedCells
=
[]
,
mc
,
i
;
for
(
var
row
=
range
.
r1
;
row
<=
range
.
r2
;
++
row
)
{
for
(
var
row
=
range
.
r1
;
row
<=
range
.
r2
;
++
row
)
{
$
.
extend
(
mergedCells
,
this
.
_drawRowBG
(
drawingCtx
,
row
,
range
.
c1
,
range
.
c2
,
offsetX
,
offsetY
,
null
),
this
.
_drawRowText
(
drawingCtx
,
row
,
range
.
c1
,
range
.
c2
,
offsetX
,
offsetY
)
);
mergedCells
=
mergedCells
.
concat
(
this
.
_drawRowBG
(
drawingCtx
,
row
,
range
.
c1
,
range
.
c2
,
offsetX
,
offsetY
,
null
),
this
.
_drawRowText
(
drawingCtx
,
row
,
range
.
c1
,
range
.
c2
,
offsetX
,
offsetY
));
}
}
// draw merged cells at last stage to fix cells background issue
// draw merged cells at last stage to fix cells background issue
for
(
i
in
mergedCells
)
{
for
(
i
=
0
;
i
<
mergedCells
.
length
;
++
i
)
{
mc
=
mergedCells
[
i
];
if
(
i
===
mergedCells
.
indexOf
(
mergedCells
[
i
]))
{
this
.
_drawRowBG
(
drawingCtx
,
mc
.
r1
,
mc
.
c1
,
mc
.
c1
,
offsetX
,
offsetY
,
mc
);
mc
=
mergedCells
[
i
];
this
.
_drawCellText
(
drawingCtx
,
mc
.
c1
,
mc
.
r1
,
range
.
c1
,
range
.
c2
,
offsetX
,
offsetY
,
true
);
this
.
_drawRowBG
(
drawingCtx
,
mc
.
r1
,
mc
.
c1
,
mc
.
c1
,
offsetX
,
offsetY
,
mc
);
this
.
_drawCellText
(
drawingCtx
,
mc
.
c1
,
mc
.
r1
,
range
.
c1
,
range
.
c2
,
offsetX
,
offsetY
,
true
);
}
}
}
return
mergedCells
;
return
mergedCells
;
};
};
...
@@ -2460,7 +2469,7 @@
...
@@ -2460,7 +2469,7 @@
return
{};
return
{};
}
}
var
mergedCells
=
{}
;
var
mergedCells
=
[]
;
var
ctx
=
(
undefined
===
drawingCtx
)
?
this
.
drawingCtx
:
drawingCtx
;
var
ctx
=
(
undefined
===
drawingCtx
)
?
this
.
drawingCtx
:
drawingCtx
;
for
(
var
col
=
colStart
;
col
<=
colEnd
;
++
col
)
{
for
(
var
col
=
colStart
;
col
<=
colEnd
;
++
col
)
{
if
(
this
.
cols
[
col
].
width
<
this
.
width_1px
&&
null
===
oMergedCell
)
{
if
(
this
.
cols
[
col
].
width
<
this
.
width_1px
&&
null
===
oMergedCell
)
{
...
@@ -2480,7 +2489,7 @@
...
@@ -2480,7 +2489,7 @@
if
(
null
===
oMergedCell
)
{
if
(
null
===
oMergedCell
)
{
mc
=
this
.
model
.
getMergedByCell
(
row
,
col
);
mc
=
this
.
model
.
getMergedByCell
(
row
,
col
);
if
(
null
!==
mc
)
{
if
(
null
!==
mc
)
{
mergedCells
[
mc
.
r1
+
"
_
"
+
mc
.
c1
]
=
{
c1
:
mc
.
c1
,
r1
:
mc
.
r1
,
c2
:
mc
.
c2
,
r2
:
mc
.
r2
}
;
mergedCells
.
push
(
mc
)
;
col
=
mc
.
c2
;
col
=
mc
.
c2
;
continue
;
continue
;
}
}
...
@@ -2540,7 +2549,7 @@
...
@@ -2540,7 +2549,7 @@
return
{};
return
{};
}
}
var
dependentCells
=
{},
mergedCells
=
{}
,
i
,
mc
,
col
;
var
dependentCells
=
{},
mergedCells
=
[]
,
i
,
mc
,
col
;
// draw cells' text
// draw cells' text
for
(
col
=
colStart
;
col
<=
colEnd
;
++
col
)
{
for
(
col
=
colStart
;
col
<=
colEnd
;
++
col
)
{
if
(
this
.
cols
[
col
].
width
<
this
.
width_1px
)
{
if
(
this
.
cols
[
col
].
width
<
this
.
width_1px
)
{
...
@@ -2548,7 +2557,7 @@
...
@@ -2548,7 +2557,7 @@
}
}
mc
=
this
.
_drawCellText
(
drawingCtx
,
col
,
row
,
colStart
,
colEnd
,
offsetX
,
offsetY
,
false
);
mc
=
this
.
_drawCellText
(
drawingCtx
,
col
,
row
,
colStart
,
colEnd
,
offsetX
,
offsetY
,
false
);
if
(
mc
!==
null
)
{
if
(
mc
!==
null
)
{
mergedCells
[
mc
.
index
]
=
{
c1
:
mc
.
c1
,
r1
:
mc
.
r1
,
c2
:
mc
.
c2
,
r2
:
mc
.
r2
}
;
mergedCells
.
push
(
mc
)
;
}
}
// check if long text overlaps this cell
// check if long text overlaps this cell
i
=
this
.
_findSourceOfCellText
(
col
,
row
);
i
=
this
.
_findSourceOfCellText
(
col
,
row
);
...
@@ -2584,7 +2593,7 @@
...
@@ -2584,7 +2593,7 @@
if
(
isMerged
)
{
if
(
isMerged
)
{
range
=
ct
.
flags
.
merged
;
range
=
ct
.
flags
.
merged
;
if
(
!
drawMergedCells
)
{
if
(
!
drawMergedCells
)
{
return
{
c1
:
range
.
c1
,
r1
:
range
.
r1
,
c2
:
range
.
c2
,
r2
:
range
.
r2
,
index
:
range
.
r1
+
"
_
"
+
range
.
c1
}
;
return
range
;
}
}
if
(
col
!==
range
.
c1
||
row
!==
range
.
r1
)
{
if
(
col
!==
range
.
c1
||
row
!==
range
.
r1
)
{
return
null
;
return
null
;
...
...
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