Commit 5965a15b authored by Alexander.Trofimov's avatar Alexander.Trofimov

add dash border cell styles

parent 4d7d067c
......@@ -776,6 +776,11 @@
return this;
};
DrawingContext.prototype.setLineDash = function (segments) {
this.ctx.setLineDash(segments);
return this;
};
DrawingContext.prototype.fillRect = function (x, y, w, h) {
var r = this._calcRect(x, y, w, h);
this.ctx.fillRect(r.x, r.y, r.w, r.h);
......
......@@ -214,6 +214,14 @@ CPdfPrinter.prototype =
this.DocumentRenderer.p_width(val * 1000 * vector_koef);
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)
{
return this;
......@@ -458,7 +466,7 @@ CPdfPrinter.prototype =
},
p_dash : function(params)
{
// TODO:
return this.DocumentRenderer.p_dash(params);
},
// brush methods
b_color1 : function(r,g,b,a)
......
......@@ -856,19 +856,18 @@ Fill.prototype =
}
}
};
var g_oBorderPropProperties = {
s: 0,
c: 1
var g_oBorderPropProperties = {
s: 0, c: 1
};
function BorderProp()
{
function BorderProp() {
this.Properties = g_oBorderPropProperties;
this.s = c_oAscBorderStyles.None;
this.w = c_oAscBorderWidth.None;
this.c = g_oColorManager.getThemeColor(1);
}
BorderProp.prototype = {
setStyle : function (style) {
}
BorderProp.prototype.setStyle = function (style) {
this.s = style;
switch (this.s) {
case c_oAscBorderStyles.Thin:
......@@ -894,63 +893,94 @@ BorderProp.prototype = {
this.w = c_oAscBorderWidth.None;
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;
if(null != this.c)
if (null != this.c) {
nRes = this.c.getRgb();
}
return nRes;
},
isEmpty : function()
{
};
BorderProp.prototype.isEmpty = function () {
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);
},
clone : function()
{
};
BorderProp.prototype.clone = function () {
var res = new BorderProp();
res.merge(this);
return res;
},
merge : function(oBorderProp)
{
if(null != oBorderProp.s && c_oAscBorderStyles.None !== oBorderProp.s)
{
};
BorderProp.prototype.merge = function (oBorderProp) {
if (null != oBorderProp.s && c_oAscBorderStyles.None !== oBorderProp.s) {
this.s = oBorderProp.s;
this.w = oBorderProp.w;
if(null != oBorderProp.c)
if (null != oBorderProp.c) {
this.c = oBorderProp.c;
}
},
getType : function()
{
}
};
BorderProp.prototype.getType = function () {
return UndoRedoDataTypes.StyleBorderProp;
},
getProperties : function()
{
};
BorderProp.prototype.getProperties = function () {
return this.Properties;
},
getProperty : function(nType)
{
switch(nType)
{
case this.Properties.s: return this.s;break;
case this.Properties.c: return this.c;break;
}
},
setProperty : function(nType, value)
{
switch(nType)
{
case this.Properties.s: this.setStyle(value);break;
case this.Properties.c: this.c = value;break;
};
BorderProp.prototype.getProperty = function (nType) {
switch (nType) {
case this.Properties.s:
return this.s;
break;
case this.Properties.c:
return this.c;
break;
}
};
BorderProp.prototype.setProperty = function (nType, value) {
switch (nType) {
case this.Properties.s:
this.setStyle(value);
break;
case this.Properties.c:
this.c = value;
break;
}
};
};
var g_oBorderProperties = {
l: 0,
t: 1,
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment