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
f8406989
Commit
f8406989
authored
Sep 23, 2016
by
Alexander.Trofimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update function _drawSelectionElement
parent
3c64f4d2
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
46 deletions
+51
-46
cell/apiDefines.js
cell/apiDefines.js
+6
-5
cell/view/WorksheetView.js
cell/view/WorksheetView.js
+43
-39
common/Charts/DrawingObjects.js
common/Charts/DrawingObjects.js
+2
-2
No files found.
cell/apiDefines.js
View file @
f8406989
...
...
@@ -322,11 +322,12 @@ var c_oAscFormulaRangeBorderColor = [
];
var
selectionLineType
=
{
Dash
:
1
,
RangeWithPromote
:
2
,
RangeWithResize
:
3
,
Range
:
4
,
RangeOut
:
5
None
:
0
,
Selection
:
1
,
ActiveCell
:
2
,
Resize
:
4
,
Promote
:
8
,
Dash
:
16
};
var
c_oAscLockNameFrozenPane
=
"
frozenPane
"
;
...
...
cell/view/WorksheetView.js
View file @
f8406989
...
...
@@ -3571,8 +3571,8 @@
var
fHorLine
,
fVerLine
;
var
isRangeOut
=
AscCommonExcel
.
selectionLineType
.
RangeOut
===
selectionLineType
;
var
isDashLine
=
AscCommonExcel
.
selectionLineType
.
Dash
===
selectionLineType
;
var
canFill
=
AscCommonExcel
.
selectionLineType
.
Selection
&
selectionLineType
;
var
isDashLine
=
AscCommonExcel
.
selectionLineType
.
Dash
&
selectionLineType
;
if
(
isDashLine
)
{
fHorLine
=
ctx
.
dashLineCleverHor
;
fVerLine
=
ctx
.
dashLineCleverVer
;
...
...
@@ -3594,7 +3594,7 @@
var
y1
=
r
[
oIntersection
.
r1
].
top
-
offsetY
;
var
y2
=
r
[
oIntersection
.
r2
].
top
+
r
[
oIntersection
.
r2
].
height
-
offsetY
;
if
(
!
isDashLine
&&
!
isRangeOut
)
{
if
(
canFill
)
{
var
fillColor
=
strokeColor
.
Copy
();
fillColor
.
a
=
0.15
;
ctx
.
setFillStyle
(
fillColor
).
fillRect
(
x1
,
y1
,
x2
-
x1
,
y2
-
y1
);
...
...
@@ -3617,7 +3617,7 @@
}
ctx
.
closePath
().
stroke
();
if
(
!
isDashLine
&&
!
isRangeOut
)
{
/*Отрисовка светлой полосы при выборе ячеек для формулы*/
if
(
canFill
)
{
/*Отрисовка светлой полосы при выборе ячеек для формулы*/
ctx
.
setLineWidth
(
1
);
ctx
.
setStrokeStyle
(
colorN
);
ctx
.
beginPath
();
...
...
@@ -3637,7 +3637,7 @@
}
// draw active cell in selection
var
isPromote
=
AscCommonExcel
.
selectionLineType
.
RangeWithPromote
===
selectionLineType
;
var
isPromote
=
AscCommonExcel
.
selectionLineType
.
Promote
&
selectionLineType
;
if
(
isPromote
)
{
var
fs
=
this
.
model
.
getMergedByCell
(
range
.
startRow
,
range
.
startCol
);
fs
=
range
.
intersectionSimple
(
...
...
@@ -3654,34 +3654,38 @@
}
// Отрисовка квадратов для move/resize
var
isResize
=
AscCommonExcel
.
selectionLineType
.
R
angeWithResize
===
selectionLineType
;
var
isResize
=
AscCommonExcel
.
selectionLineType
.
R
esize
&
selectionLineType
;
if
(
isResize
||
isPromote
)
{
ctx
.
setFillStyle
(
colorN
);
if
(
isResize
&&
drawLeftSide
&&
drawTopSide
)
{
if
(
drawRightSide
&&
drawBottomSide
)
{
ctx
.
fillRect
(
x2
-
width_4px
,
y2
-
height_4px
,
width_7px
,
height_7px
);
}
ctx
.
setFillStyle
(
strokeColor
);
if
(
drawRightSide
&&
drawBottomSide
)
{
ctx
.
fillRect
(
x2
-
width_3px
,
y2
-
height_3px
,
width_5px
,
height_5px
);
}
if
(
isResize
)
{
ctx
.
setFillStyle
(
colorN
);
if
(
drawLeftSide
&&
drawTopSide
)
{
ctx
.
fillRect
(
x1
-
width_4px
,
y1
-
height_4px
,
width_7px
,
height_7px
);
}
if
(
isResize
&&
drawRightSide
&&
drawTopSide
)
{
if
(
drawRightSide
&&
drawTopSide
)
{
ctx
.
fillRect
(
x2
-
width_4px
,
y1
-
height_4px
,
width_7px
,
height_7px
);
}
if
(
isResize
&&
drawLeftSide
&&
drawBottomSide
)
{
if
(
drawLeftSide
&&
drawBottomSide
)
{
ctx
.
fillRect
(
x1
-
width_4px
,
y2
-
height_4px
,
width_7px
,
height_7px
);
}
if
(
drawRightSide
&&
drawBottomSide
)
{
ctx
.
fillRect
(
x2
-
width_4px
,
y2
-
height_4px
,
width_7px
,
height_7px
);
}
ctx
.
setFillStyle
(
strokeColor
);
if
(
isResize
&&
drawLeftSide
&&
drawTopSide
)
{
if
(
drawLeftSide
&&
drawTopSide
)
{
ctx
.
fillRect
(
x1
-
width_3px
,
y1
-
height_3px
,
width_5px
,
height_5px
);
}
if
(
isResize
&&
drawRightSide
&&
drawTopSide
)
{
if
(
drawRightSide
&&
drawTopSide
)
{
ctx
.
fillRect
(
x2
-
width_3px
,
y1
-
height_3px
,
width_5px
,
height_5px
);
}
if
(
isResize
&&
drawLeftSide
&&
drawBottomSide
)
{
if
(
drawLeftSide
&&
drawBottomSide
)
{
ctx
.
fillRect
(
x1
-
width_3px
,
y2
-
height_3px
,
width_5px
,
height_5px
);
}
if
(
drawRightSide
&&
drawBottomSide
)
{
ctx
.
fillRect
(
x2
-
width_3px
,
y2
-
height_3px
,
width_5px
,
height_5px
);
}
}
return
true
;
...
...
@@ -3761,6 +3765,10 @@
}
else
{
this
.
_drawSelectionRange
();
if
(
this
.
activeFillHandle
)
{
this
.
_drawElements
(
this
.
_drawSelectionElement
,
this
.
activeFillHandle
.
clone
(
true
),
AscCommonExcel
.
selectionLineType
.
None
,
this
.
settings
.
activeCellBorderColor
);
}
if
(
this
.
isFormulaEditMode
)
{
this
.
_drawFormulaRanges
(
this
.
arrActiveFormulaRanges
);
}
...
...
@@ -3775,7 +3783,7 @@
}
if
(
null
!==
this
.
activeMoveRange
)
{
this
.
_drawElements
(
this
.
_drawSelectionElement
,
this
.
activeMoveRange
,
AscCommonExcel
.
selectionLineType
.
RangeOut
,
new
CColor
(
0
,
0
,
0
));
AscCommonExcel
.
selectionLineType
.
None
,
new
CColor
(
0
,
0
,
0
));
}
}
}
...
...
@@ -3799,12 +3807,8 @@
}
this
.
_drawElements
(
this
.
_drawSelectionElement
,
this
.
activeRange
,
AscCommonExcel
.
selectionLineType
.
RangeWithPromote
,
this
.
settings
.
activeCellBorderColor
);
if
(
this
.
activeFillHandle
)
{
this
.
_drawElements
(
this
.
_drawSelectionElement
,
this
.
activeFillHandle
.
clone
(
true
),
AscCommonExcel
.
selectionLineType
.
RangeOut
,
this
.
settings
.
activeCellBorderColor
);
}
AscCommonExcel
.
selectionLineType
.
Selection
|
AscCommonExcel
.
selectionLineType
.
ActiveCell
|
AscCommonExcel
.
selectionLineType
.
Promote
,
this
.
settings
.
activeCellBorderColor
);
};
WorksheetView
.
prototype
.
_drawFormatPainterRange
=
function
()
{
...
...
@@ -3825,8 +3829,8 @@
strokeColor
=
AscCommonExcel
.
c_oAscFormulaRangeBorderColor
[
colorIndex
%
length
];
this
.
_drawElements
(
this
.
_drawSelectionElement
,
oFormulaRange
,
arrRanges
[
i
].
isName
?
AscCommonExcel
.
selectionLineType
.
Rang
e
:
AscCommonExcel
.
selectionLineType
.
R
angeWithResize
,
strokeColor
);
AscCommonExcel
.
selectionLineType
.
Selection
|
(
arrRanges
[
i
].
isName
?
AscCommonExcel
.
selectionLineType
.
Non
e
:
AscCommonExcel
.
selectionLineType
.
R
esize
)
,
strokeColor
);
}
};
...
...
@@ -5947,7 +5951,7 @@
y1
=
this
.
rows
[
oFormulaRangeIn
.
r1
].
top
-
offsetY
;
y2
=
this
.
rows
[
oFormulaRangeIn
.
r2
].
top
+
this
.
rows
[
oFormulaRangeIn
.
r2
].
height
-
offsetY
;
isResize
=
AscCommonExcel
.
selectionLineType
.
R
angeWithResize
===
rangeType
;
isResize
=
AscCommonExcel
.
selectionLineType
.
R
esize
&
rangeType
;
if
(
isResize
&&
this
.
_hitResizeCorner
(
x1
-
this
.
width_1px
,
y1
-
this
.
height_1px
,
x
,
y
))
{
/*TOP-LEFT*/
...
...
@@ -5986,8 +5990,9 @@
};
WorksheetView
.
prototype
.
_hitCursorSelectionRange
=
function
(
vr
,
x
,
y
,
offsetX
,
offsetY
)
{
var
res
=
this
.
_hitInRange
(
this
.
activeRange
,
AscCommonExcel
.
selectionLineType
.
RangeWithPromote
,
vr
,
x
,
y
,
offsetX
,
offsetY
);
var
res
=
this
.
_hitInRange
(
this
.
activeRange
,
AscCommonExcel
.
selectionLineType
.
Selection
|
AscCommonExcel
.
selectionLineType
.
ActiveCell
|
AscCommonExcel
.
selectionLineType
.
Promote
,
vr
,
x
,
y
,
offsetX
,
offsetY
);
return
res
?
{
cursor
:
kCurMove
===
res
.
cursor
?
kCurMove
:
kCurFillHandle
,
target
:
kCurMove
===
res
.
cursor
?
c_oTargetType
.
MoveRange
:
c_oTargetType
.
FillHandle
,
...
...
@@ -6006,8 +6011,7 @@
oFormulaRange
=
arrRanges
[
i
].
clone
(
true
);
oFormulaRange
.
isName
=
arrRanges
[
i
].
isName
;
res
=
!
oFormulaRange
.
isName
&&
this
.
_hitInRange
(
oFormulaRange
,
AscCommonExcel
.
selectionLineType
.
RangeWithResize
,
vr
,
x
,
y
,
offsetX
,
offsetY
);
this
.
_hitInRange
(
oFormulaRange
,
AscCommonExcel
.
selectionLineType
.
Resize
,
vr
,
x
,
y
,
offsetX
,
offsetY
);
if
(
res
)
{
break
;
}
...
...
common/Charts/DrawingObjects.js
View file @
f8406989
...
...
@@ -3956,14 +3956,14 @@ function DrawingObjects() {
{
worksheet
.
_drawElements
(
worksheet
.
_drawSelectionElement
,
asc
.
Range
(
drawing
.
bbox
.
serBBox
.
c1
,
drawing
.
bbox
.
serBBox
.
r1
,
drawing
.
bbox
.
serBBox
.
c2
,
drawing
.
bbox
.
serBBox
.
r2
,
true
),
AscCommonExcel
.
selectionLineType
.
RangeWith
Resize
,
drawing
.
bbox
.
serBBox
.
r2
,
true
),
AscCommonExcel
.
selectionLineType
.
Selection
|
AscCommonExcel
.
selectionLineType
.
Resize
,
AscCommonExcel
.
c_oAscFormulaRangeBorderColor
[
1
]);
}
if
(
drawing
.
bbox
.
catBBox
)
{
worksheet
.
_drawElements
(
worksheet
.
_drawSelectionElement
,
asc
.
Range
(
drawing
.
bbox
.
catBBox
.
c1
,
drawing
.
bbox
.
catBBox
.
r1
,
drawing
.
bbox
.
catBBox
.
c2
,
drawing
.
bbox
.
catBBox
.
r2
,
true
),
AscCommonExcel
.
selectionLineType
.
RangeWith
Resize
,
drawing
.
bbox
.
catBBox
.
r2
,
true
),
AscCommonExcel
.
selectionLineType
.
Selection
|
AscCommonExcel
.
selectionLineType
.
Resize
,
AscCommonExcel
.
c_oAscFormulaRangeBorderColor
[
2
]);
}
var
BB
=
drawing
.
bbox
.
seriesBBox
;
...
...
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