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
1f3eb8fd
Commit
1f3eb8fd
authored
May 16, 2017
by
GoshaZotov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
+ previous commit
parent
bb5352ff
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
59 deletions
+62
-59
cell/view/WorksheetView.js
cell/view/WorksheetView.js
+62
-59
No files found.
cell/view/WorksheetView.js
View file @
1f3eb8fd
...
...
@@ -12493,10 +12493,8 @@
};
WorksheetView
.
prototype
.
af_drawButtons
=
function
(
updatedRange
,
offsetX
,
offsetY
)
{
var
ws
=
this
;
var
aWs
=
this
.
model
;
var
t
=
this
;
var
m_oColor
=
new
CColor
(
120
,
120
,
120
);
if
(
aWs
.
workbook
.
bUndoChanges
||
aWs
.
workbook
.
bRedoChanges
)
{
return
false
;
...
...
@@ -12577,6 +12575,7 @@
WorksheetView
.
prototype
.
af_drawCurrentButton
=
function
(
offsetX
,
offsetY
,
props
)
{
var
t
=
this
;
var
ctx
=
t
.
drawingCtx
;
//TODO пересмотреть масштабирование!!!
var
isApplyAutoFilter
=
props
.
isSetFilter
;
...
...
@@ -12584,36 +12583,41 @@
var
row
=
props
.
row
;
var
col
=
props
.
col
;
var
width1
=
13
;
var
height1
=
13
;
var
rowHeight1
=
t
.
rows
[
row
].
height
;
if
(
rowHeight1
<
height1
)
{
width1
=
width1
*
(
rowHeight1
/
height1
);
height1
=
rowHeight1
;
}
var
widthButtonPx
=
17
;
var
heightButtonPx
=
17
;
var
widthBorder
=
1
;
var
x1
=
t
.
cols
[
col
].
left
+
t
.
cols
[
col
].
width
-
width1
-
0.5
-
offsetX
;
var
y1
=
t
.
rows
[
row
].
top
+
t
.
rows
[
row
].
height
-
height1
-
0.5
-
offsetY
;
var
scaleIndex
=
1
;
var
scaleFactor
=
ctx
.
scaleFactor
;
var
width_1px
=
t
.
width_1px
;
var
height_1px
=
t
.
height_1px
;
var
height
=
15
*
width_1px
;
var
width
=
15
*
height_1px
;
var
m_oColor
=
new
CColor
(
120
,
120
,
120
);
var
rowHeight
=
t
.
rows
[
row
].
height
;
var
m_oColor
=
new
CColor
(
120
,
120
,
120
);
var
widthWithBorders
=
widthButtonPx
*
width_1px
;
var
heightWithBorders
=
heightButtonPx
*
height_1px
;
var
width
=
(
widthButtonPx
-
widthBorder
*
2
)
*
width_1px
;
var
height
=
(
heightButtonPx
-
widthBorder
*
2
)
*
height_1px
;
var
colWidth
=
t
.
cols
[
col
].
width
;
var
rowHeight
=
t
.
rows
[
row
].
height
;
if
(
rowHeight
<
heightWithBorders
)
{
widthWithBorders
=
widthWithBorders
*
(
rowHeight
/
heightWithBorders
);
heightWithBorders
=
rowHeight
;
}
var
scaleIndex
=
1
;
var
scaleFactor
=
t
.
drawingCtx
.
scaleFactor
;
//стартовая позиция кнопки
var
x1
=
t
.
cols
[
col
].
left
+
t
.
cols
[
col
].
width
-
widthWithBorders
-
0.5
-
offsetX
;
var
y1
=
t
.
rows
[
row
].
top
+
t
.
rows
[
row
].
height
-
heightWithBorders
-
0.5
-
offsetY
;
var
_drawButtonFrame
=
function
(
startX
,
startY
,
width
,
height
)
{
t
.
drawingC
tx
.
setFillStyle
(
t
.
settings
.
cells
.
defaultState
.
background
);
t
.
drawingC
tx
.
setLineWidth
(
1
);
t
.
drawingC
tx
.
setStrokeStyle
(
t
.
settings
.
cells
.
defaultState
.
border
);
t
.
drawingC
tx
.
fillRect
(
startX
,
startY
,
width
,
height
);
t
.
drawingCtx
.
strokeRect
(
startX
,
startY
,
width
,
height
);
c
tx
.
setFillStyle
(
t
.
settings
.
cells
.
defaultState
.
background
);
c
tx
.
setLineWidth
(
1
);
c
tx
.
setStrokeStyle
(
t
.
settings
.
cells
.
defaultState
.
border
);
c
tx
.
fillRect
(
startX
,
startY
,
width
,
height
);
ctx
.
strokeRect
(
startX
,
startY
,
width
,
height
);
};
var
_drawSortArrow
=
function
(
startX
,
startY
,
isDescending
,
heightArrow
)
...
...
@@ -12622,7 +12626,6 @@
//isDescending = true - стрелочка смотрит вниз
//рисуем сверху вниз
var
ctx
=
t
.
drawingCtx
;
ctx
.
beginPath
();
ctx
.
lineVer
(
startX
,
startY
,
startY
+
heightArrow
);
...
...
@@ -12630,7 +12633,7 @@
if
(
isDescending
)
{
var
r
=
t
.
drawingC
tx
.
_calcRect
(
startX
,
startY
);
var
r
=
c
tx
.
_calcRect
(
startX
,
startY
);
var
x
=
Math
.
round
(
r
.
x
);
var
y
=
Math
.
round
(
r
.
y
);
...
...
@@ -12639,16 +12642,16 @@
var
diffY
=
0
;
for
(
var
i
=
0
;
i
<
height
;
i
++
)
{
t
.
drawingC
tx
.
ctx
.
moveTo
(
x
-
(
i
),
y
+
0.5
-
(
i
)
+
heightArrow1
+
height
-
1
);
t
.
drawingC
tx
.
ctx
.
lineTo
(
x
-
(
i
)
+
1
,
y
+
0.5
-
(
i
)
+
heightArrow1
+
height
-
1
);
t
.
drawingC
tx
.
ctx
.
moveTo
(
x
+
i
,
y
+
0.5
-
(
i
)
+
heightArrow1
+
height
-
1
);
t
.
drawingC
tx
.
ctx
.
lineTo
(
x
+
i
+
1
,
y
+
0.5
-
(
i
)
+
heightArrow1
+
height
-
1
);
c
tx
.
ctx
.
moveTo
(
x
-
(
i
),
y
+
0.5
-
(
i
)
+
heightArrow1
+
height
-
1
);
c
tx
.
ctx
.
lineTo
(
x
-
(
i
)
+
1
,
y
+
0.5
-
(
i
)
+
heightArrow1
+
height
-
1
);
c
tx
.
ctx
.
moveTo
(
x
+
i
,
y
+
0.5
-
(
i
)
+
heightArrow1
+
height
-
1
);
c
tx
.
ctx
.
lineTo
(
x
+
i
+
1
,
y
+
0.5
-
(
i
)
+
heightArrow1
+
height
-
1
);
}
}
else
{
var
r
=
t
.
drawingC
tx
.
_calcRect
(
startX
,
startY
);
var
r
=
c
tx
.
_calcRect
(
startX
,
startY
);
var
x
=
Math
.
round
(
r
.
x
);
var
y
=
Math
.
round
(
r
.
y
);
...
...
@@ -12656,11 +12659,11 @@
var
diffY
=
0
;
for
(
var
i
=
0
;
i
<
height
;
i
++
)
{
t
.
drawingC
tx
.
ctx
.
moveTo
(
x
-
(
i
),
y
+
0.5
+
(
i
)
-
diffY
);
t
.
drawingC
tx
.
ctx
.
lineTo
(
x
-
(
i
)
+
1
,
y
+
0.5
+
(
i
)
-
diffY
);
t
.
drawingC
tx
.
ctx
.
moveTo
(
x
+
i
,
y
+
0.5
+
(
i
)
-
diffY
);
t
.
drawingC
tx
.
ctx
.
lineTo
(
x
+
i
+
1
,
y
+
0.5
+
(
i
)
-
diffY
);
c
tx
.
ctx
.
moveTo
(
x
-
(
i
),
y
+
0.5
+
(
i
)
-
diffY
);
c
tx
.
ctx
.
lineTo
(
x
-
(
i
)
+
1
,
y
+
0.5
+
(
i
)
-
diffY
);
c
tx
.
ctx
.
moveTo
(
x
+
i
,
y
+
0.5
+
(
i
)
-
diffY
);
c
tx
.
ctx
.
lineTo
(
x
+
i
+
1
,
y
+
0.5
+
(
i
)
-
diffY
);
}
}
...
...
@@ -12675,18 +12678,18 @@
y
=
Math
.
round
((
y
)
/
height_1px
)
*
height_1px
;
var
heightLine
=
Math
.
round
(
height
);
var
heightCleanLine
=
heightLine
-
4
+
2
;
t
.
drawingC
tx
.
beginPath
();
t
.
drawingC
tx
.
moveTo
(
x
,
y
);
t
.
drawingC
tx
.
lineTo
(
x
,
y
-
heightCleanLine
);
t
.
drawingC
tx
.
setLineWidth
(
t
.
width_2px
);
t
.
drawingC
tx
.
setStrokeStyle
(
m_oColor
);
t
.
drawingC
tx
.
setStrokeStyle
(
m_oColor
);
t
.
drawingC
tx
.
stroke
();
c
tx
.
beginPath
();
c
tx
.
moveTo
(
x
,
y
);
c
tx
.
lineTo
(
x
,
y
-
heightCleanLine
);
c
tx
.
setLineWidth
(
t
.
width_2px
);
c
tx
.
setStrokeStyle
(
m_oColor
);
c
tx
.
setStrokeStyle
(
m_oColor
);
c
tx
.
stroke
();
var
r
=
t
.
drawingC
tx
.
_calcRect
(
x
,
y
-
heightLine
);
var
r
=
c
tx
.
_calcRect
(
x
,
y
-
heightLine
);
x
=
Math
.
round
(
r
.
x
)
+
1
;
y
=
Math
.
round
(
r
.
y
)
-
1
;
...
...
@@ -12694,33 +12697,33 @@
var
diffY
=
0
;
for
(
var
i
=
0
;
i
<
heightTriangle
;
i
++
)
{
t
.
drawingC
tx
.
ctx
.
moveTo
(
x
-
(
i
)
-
2
,
y
+
0.5
+
(
heightTriangle
-
i
)
-
diffY
);
t
.
drawingC
tx
.
ctx
.
lineTo
(
x
+
i
,
y
+
0.5
+
(
heightTriangle
-
i
)
-
diffY
);
c
tx
.
ctx
.
moveTo
(
x
-
(
i
)
-
2
,
y
+
0.5
+
(
heightTriangle
-
i
)
-
diffY
);
c
tx
.
ctx
.
lineTo
(
x
+
i
,
y
+
0.5
+
(
heightTriangle
-
i
)
-
diffY
);
}
t
.
drawingC
tx
.
setLineWidth
(
t
.
width_1px
);
t
.
drawingC
tx
.
setStrokeStyle
(
m_oColor
);
t
.
drawingC
tx
.
stroke
();
c
tx
.
setLineWidth
(
t
.
width_1px
);
c
tx
.
setStrokeStyle
(
m_oColor
);
c
tx
.
stroke
();
};
var
_drawFilterDreieck
=
function
(
x
,
y
,
height
)
{
var
r
=
t
.
drawingC
tx
.
_calcRect
(
x
,
y
);
var
r
=
c
tx
.
_calcRect
(
x
,
y
);
x
=
Math
.
round
(
r
.
x
)
+
1
;
y
=
Math
.
round
(
r
.
y
);
t
.
drawingC
tx
.
beginPath
();
c
tx
.
beginPath
();
height
=
Math
.
round
(
height
*
scaleIndex
*
scaleFactor
);
var
diffY
=
Math
.
round
(
height
/
2
);
for
(
var
i
=
0
;
i
<
height
;
i
++
)
{
t
.
drawingC
tx
.
ctx
.
moveTo
(
x
-
(
i
+
1
),
y
+
0.5
+
(
height
-
i
)
-
diffY
);
t
.
drawingC
tx
.
ctx
.
lineTo
(
x
+
i
,
y
+
0.5
+
(
height
-
i
)
-
diffY
);
c
tx
.
ctx
.
moveTo
(
x
-
(
i
+
1
),
y
+
0.5
+
(
height
-
i
)
-
diffY
);
c
tx
.
ctx
.
lineTo
(
x
+
i
,
y
+
0.5
+
(
height
-
i
)
-
diffY
);
}
t
.
drawingC
tx
.
setStrokeStyle
(
m_oColor
);
t
.
drawingC
tx
.
stroke
();
c
tx
.
setStrokeStyle
(
m_oColor
);
c
tx
.
stroke
();
};
//TODO пересмотреть отрисовку кнопок + отрисовку при масштабировании
...
...
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