New: CGContextSetLineDash.

This commit is contained in:
Alexander Ljungberg committed 2013-03-20 14:06:01 +00:00
1 parent 085654e751
commit ab692bb15d
2 files changed
+29

No files matched your search

+6
View File
@@ -166,6 +166,12 @@ function CGContextSetLineCap(aContext, aLineCap)
aContext.gState.lineCap = aLineCap;
}
function CGContextSetLineDash(aContext, aPhase, someDashes)
{
aContext.gState.lineDashes = someDashes;
aContext.gState.lineDashesPhase = aPhase;
}
function CGContextSetLineJoin(aContext, aLineJoin)
{
aContext.gState.lineJoin = aLineJoin;
+23
View File
@@ -68,6 +68,29 @@ function CGContextSetLineCap(aContext, aLineCap)
aContext.lineCap = CANVAS_LINECAP_TABLE[aLineCap];
}
function CGContextSetLineDash(aContext, aPhase, someDashes)
{
if (aContext.setLineDash)
{
aContext.setLineDash(someDashes);
aContext.lineDashOffset = aPhase;
}
else if (typeof aContext['webkitLineDash'] !== 'undefined')
{
aContext.webkitLineDash = someDashes;
aContext.webkitLineDashOffset = aPhase;
}
else if (typeof aContext['mozDash'] !== 'undefined')
{
aContext.mozDash = someDashes;
aContext.mozLineDashOffset = aPhase;
}
else if (someDashes)
{
CPLog.warn("CGContextSetLineDash not implemented in this environment.")
}
}
function CGContextSetLineJoin(aContext, aLineJoin)
{
aContext.lineJoin = CANVAS_LINEJOIN_TABLE[aLineJoin];