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
5965a15b
Commit
5965a15b
authored
Jan 13, 2017
by
Alexander.Trofimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add dash border cell styles
parent
4d7d067c
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
365 additions
and
301 deletions
+365
-301
cell/graphics/DrawingContext.js
cell/graphics/DrawingContext.js
+5
-0
cell/graphics/pdfprinter.js
cell/graphics/pdfprinter.js
+9
-1
cell/model/WorkbookElems.js
cell/model/WorkbookElems.js
+83
-53
cell/view/WorksheetView.js
cell/view/WorksheetView.js
+268
-247
No files found.
cell/graphics/DrawingContext.js
View file @
5965a15b
...
@@ -776,6 +776,11 @@
...
@@ -776,6 +776,11 @@
return
this
;
return
this
;
};
};
DrawingContext
.
prototype
.
setLineDash
=
function
(
segments
)
{
this
.
ctx
.
setLineDash
(
segments
);
return
this
;
};
DrawingContext
.
prototype
.
fillRect
=
function
(
x
,
y
,
w
,
h
)
{
DrawingContext
.
prototype
.
fillRect
=
function
(
x
,
y
,
w
,
h
)
{
var
r
=
this
.
_calcRect
(
x
,
y
,
w
,
h
);
var
r
=
this
.
_calcRect
(
x
,
y
,
w
,
h
);
this
.
ctx
.
fillRect
(
r
.
x
,
r
.
y
,
r
.
w
,
r
.
h
);
this
.
ctx
.
fillRect
(
r
.
x
,
r
.
y
,
r
.
w
,
r
.
h
);
...
...
cell/graphics/pdfprinter.js
View file @
5965a15b
...
@@ -214,6 +214,14 @@ CPdfPrinter.prototype =
...
@@ -214,6 +214,14 @@ CPdfPrinter.prototype =
this
.
DocumentRenderer
.
p_width
(
val
*
1000
*
vector_koef
);
this
.
DocumentRenderer
.
p_width
(
val
*
1000
*
vector_koef
);
return
this
;
return
this
;
},
},
setLineDash
:
function
(
params
)
{
var
tmp
=
[];
for
(
var
i
=
0
;
i
<
params
.
length
;
++
i
)
{
tmp
.
push
(
params
[
i
]
*
vector_koef
);
}
return
this
.
DocumentRenderer
.
p_dash
(
tmp
);
},
setLineCap
:
function
(
cap
)
setLineCap
:
function
(
cap
)
{
{
return
this
;
return
this
;
...
@@ -458,7 +466,7 @@ CPdfPrinter.prototype =
...
@@ -458,7 +466,7 @@ CPdfPrinter.prototype =
},
},
p_dash
:
function
(
params
)
p_dash
:
function
(
params
)
{
{
// TODO:
return
this
.
DocumentRenderer
.
p_dash
(
params
);
},
},
// brush methods
// brush methods
b_color1
:
function
(
r
,
g
,
b
,
a
)
b_color1
:
function
(
r
,
g
,
b
,
a
)
...
...
cell/model/WorkbookElems.js
View file @
5965a15b
...
@@ -856,19 +856,18 @@ Fill.prototype =
...
@@ -856,19 +856,18 @@ Fill.prototype =
}
}
}
}
};
};
var
g_oBorderPropProperties
=
{
var
g_oBorderPropProperties
=
{
s
:
0
,
s
:
0
,
c
:
1
c
:
1
};
};
function
BorderProp
()
{
function
BorderProp
()
{
this
.
Properties
=
g_oBorderPropProperties
;
this
.
Properties
=
g_oBorderPropProperties
;
this
.
s
=
c_oAscBorderStyles
.
None
;
this
.
s
=
c_oAscBorderStyles
.
None
;
this
.
w
=
c_oAscBorderWidth
.
None
;
this
.
w
=
c_oAscBorderWidth
.
None
;
this
.
c
=
g_oColorManager
.
getThemeColor
(
1
);
this
.
c
=
g_oColorManager
.
getThemeColor
(
1
);
}
}
BorderProp
.
prototype
=
{
setStyle
:
function
(
style
)
{
BorderProp
.
prototype
.
setStyle
=
function
(
style
)
{
this
.
s
=
style
;
this
.
s
=
style
;
switch
(
this
.
s
)
{
switch
(
this
.
s
)
{
case
c_oAscBorderStyles
.
Thin
:
case
c_oAscBorderStyles
.
Thin
:
...
@@ -894,63 +893,94 @@ BorderProp.prototype = {
...
@@ -894,63 +893,94 @@ BorderProp.prototype = {
this
.
w
=
c_oAscBorderWidth
.
None
;
this
.
w
=
c_oAscBorderWidth
.
None
;
break
;
break
;
}
}
},
};
getRgbOrNull
:
function
()
BorderProp
.
prototype
.
getDashSegments
=
function
()
{
{
var
res
;
switch
(
this
.
s
)
{
case
c_oAscBorderStyles
.
Hair
:
res
=
[
1
,
1
];
break
;
case
c_oAscBorderStyles
.
Dotted
:
res
=
[
2
,
2
];
break
;
case
c_oAscBorderStyles
.
DashDotDot
:
case
c_oAscBorderStyles
.
MediumDashDotDot
:
res
=
[
3
,
3
,
3
,
3
,
9
,
3
];
break
;
case
c_oAscBorderStyles
.
DashDot
:
case
c_oAscBorderStyles
.
MediumDashDot
:
case
c_oAscBorderStyles
.
SlantDashDot
:
res
=
[
3
,
3
,
9
,
3
];
break
;
case
c_oAscBorderStyles
.
Dashed
:
res
=
[
3
,
1
];
break
;
case
c_oAscBorderStyles
.
MediumDashed
:
res
=
[
9
,
3
];
break
;
case
c_oAscBorderStyles
.
Thin
:
case
c_oAscBorderStyles
.
Medium
:
case
c_oAscBorderStyles
.
Thick
:
case
c_oAscBorderStyles
.
Double
:
default
:
res
=
[];
break
;
}
return
res
;
};
BorderProp
.
prototype
.
getRgbOrNull
=
function
()
{
var
nRes
=
null
;
var
nRes
=
null
;
if
(
null
!=
this
.
c
)
if
(
null
!=
this
.
c
)
{
nRes
=
this
.
c
.
getRgb
();
nRes
=
this
.
c
.
getRgb
();
}
return
nRes
;
return
nRes
;
},
};
isEmpty
:
function
()
BorderProp
.
prototype
.
isEmpty
=
function
()
{
{
return
c_oAscBorderStyles
.
None
===
this
.
s
;
return
c_oAscBorderStyles
.
None
===
this
.
s
;
},
};
isEqual
:
function
(
val
)
BorderProp
.
prototype
.
isEqual
=
function
(
val
)
{
{
return
this
.
s
===
val
.
s
&&
g_oColorManager
.
isEqual
(
this
.
c
,
val
.
c
);
return
this
.
s
===
val
.
s
&&
g_oColorManager
.
isEqual
(
this
.
c
,
val
.
c
);
},
};
clone
:
function
()
BorderProp
.
prototype
.
clone
=
function
()
{
{
var
res
=
new
BorderProp
();
var
res
=
new
BorderProp
();
res
.
merge
(
this
);
res
.
merge
(
this
);
return
res
;
return
res
;
},
};
merge
:
function
(
oBorderProp
)
BorderProp
.
prototype
.
merge
=
function
(
oBorderProp
)
{
{
if
(
null
!=
oBorderProp
.
s
&&
c_oAscBorderStyles
.
None
!==
oBorderProp
.
s
)
{
if
(
null
!=
oBorderProp
.
s
&&
c_oAscBorderStyles
.
None
!==
oBorderProp
.
s
)
{
this
.
s
=
oBorderProp
.
s
;
this
.
s
=
oBorderProp
.
s
;
this
.
w
=
oBorderProp
.
w
;
this
.
w
=
oBorderProp
.
w
;
if
(
null
!=
oBorderProp
.
c
)
if
(
null
!=
oBorderProp
.
c
)
{
this
.
c
=
oBorderProp
.
c
;
this
.
c
=
oBorderProp
.
c
;
}
}
}
},
};
getType
:
function
()
BorderProp
.
prototype
.
getType
=
function
()
{
{
return
UndoRedoDataTypes
.
StyleBorderProp
;
return
UndoRedoDataTypes
.
StyleBorderProp
;
},
};
getProperties
:
function
()
BorderProp
.
prototype
.
getProperties
=
function
()
{
{
return
this
.
Properties
;
return
this
.
Properties
;
},
};
getProperty
:
function
(
nType
)
BorderProp
.
prototype
.
getProperty
=
function
(
nType
)
{
{
switch
(
nType
)
{
switch
(
nType
)
case
this
.
Properties
.
s
:
{
return
this
.
s
;
case
this
.
Properties
.
s
:
return
this
.
s
;
break
;
break
;
case
this
.
Properties
.
c
:
return
this
.
c
;
break
;
case
this
.
Properties
.
c
:
return
this
.
c
;
break
;
}
}
},
};
setProperty
:
function
(
nType
,
value
)
BorderProp
.
prototype
.
setProperty
=
function
(
nType
,
value
)
{
{
switch
(
nType
)
{
switch
(
nType
)
case
this
.
Properties
.
s
:
{
this
.
setStyle
(
value
);
case
this
.
Properties
.
s
:
this
.
setStyle
(
value
);
break
;
break
;
case
this
.
Properties
.
c
:
this
.
c
=
value
;
break
;
case
this
.
Properties
.
c
:
this
.
c
=
value
;
break
;
}
}
}
};
};
var
g_oBorderProperties
=
{
var
g_oBorderProperties
=
{
l
:
0
,
l
:
0
,
t
:
1
,
t
:
1
,
...
...
cell/view/WorksheetView.js
View file @
5965a15b
This diff is collapsed.
Click to expand it.
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