mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-11-10 00:48:45 +00:00
Added CGContextSetAlpha VML implementation for use in IE, and fixed a bug where CGContextCanvas.j and CGContextVML.j were being added to AppKit.sj inappropriately.
Reviewed by me.
This commit is contained in:
1 parent
581a004ed0
commit
8adaa2d3c8
3 files changed
+15
-3
No files matched your search
@@ -14,6 +14,9 @@
|
||||
<string>CPOutlineView.j</string>
|
||||
<string>CPTableColumn.j</string>
|
||||
<string>CPTableView.j</string>
|
||||
<!-- These get compiled into CGContext -->
|
||||
<string>CoreGraphics/CGContextCanvas.j</string>
|
||||
<string>CoreGraphics/CGContextVML.j</string>
|
||||
</array>
|
||||
<key>Flags</key>
|
||||
<string>-DPLATFORM_DOM</string>
|
||||
@@ -26,6 +29,9 @@
|
||||
<string>CPOutlineView.j</string>
|
||||
<string>CPTableColumn.j</string>
|
||||
<string>CPTableView.j</string>
|
||||
<!-- These get compiled into CGContext -->
|
||||
<string>CoreGraphics/CGContextCanvas.j</string>
|
||||
<string>CoreGraphics/CGContextVML.j</string>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
|
||||
@@ -208,14 +208,14 @@ if (!CPFeatureIsCompatible(CPHTMLCanvasFeature))
|
||||
|
||||
function CGGStateCreate()
|
||||
{
|
||||
return { strokeStyle:"#000", fillStyle:"#ccc", lineWidth:1.0, lineJoin:kCGLineJoinMiter, lineCap:kCGLineCapButt, miterLimit:10.0, globalAlpha:1.0,
|
||||
return { alpha:1.0, strokeStyle:"#000", fillStyle:"#ccc", lineWidth:1.0, lineJoin:kCGLineJoinMiter, lineCap:kCGLineCapButt, miterLimit:10.0, globalAlpha:1.0,
|
||||
blendMode:kCGBlendModeNormal,
|
||||
shadowOffset:_CGSizeMakeZero(), shadowBlur:0.0, shadowColor:NULL, CTM:_CGAffineTransformMakeIdentity() };
|
||||
}
|
||||
|
||||
function CGGStateCreateCopy(aGState)
|
||||
{
|
||||
return { strokeStyle:aGState.strokeStyle, fillStyle:aGState.fillStyle, lineWidth:aGState.lineWidth,
|
||||
return { alpha:aGState.alpha, strokeStyle:aGState.strokeStyle, fillStyle:aGState.fillStyle, lineWidth:aGState.lineWidth,
|
||||
lineJoin:aGState.lineJoin, lineCap:aGState.lineCap, miterLimit:aGState.miterLimit, globalAlpha:aGState.globalAlpha,
|
||||
blendMode:aGState.blendMode,
|
||||
shadowOffset:aGState.shadowOffset, shadowBlur:aGState.shadowBlur, shadowColor:aGState.shadowColor, CTM:_CGAffineTransformMakeCopy(aGState.CTM) };
|
||||
@@ -418,6 +418,11 @@ function CGContextSetShadowWithColor(aContext, aSize, aBlur, aColor)
|
||||
gState.shadowColor = aColor;
|
||||
}
|
||||
|
||||
function CGContextSetAlpha(aContext, anAlpha)
|
||||
{
|
||||
aContext.gState.alpha = MAX(MIN(anAlpha, 1.0), 0.0);
|
||||
}
|
||||
|
||||
} // END CANVAS IF
|
||||
|
||||
// GOOD.
|
||||
|
||||
@@ -111,7 +111,7 @@ function CGContextDrawPath(aContext, aMode)
|
||||
{
|
||||
if (!aContext || CGPathIsEmpty(aContext.path))
|
||||
return;
|
||||
var opacity = 1.0;
|
||||
|
||||
var elements = aContext.path.elements,
|
||||
|
||||
i = 0,
|
||||
@@ -120,6 +120,7 @@ var opacity = 1.0;
|
||||
gState = aContext.gState,
|
||||
fill = (aMode == kCGPathFill || aMode == kCGPathFillStroke) ? 1 : 0,
|
||||
stroke = (aMode == kCGPathStroke || aMode == kCGPathFillStroke) ? 1 : 0,
|
||||
opacity = gState.alpha,
|
||||
vml = [ "<cg_vml_:shape",
|
||||
" fillcolor=\"", gState.fillStyle,
|
||||
"\" filled=\"", VML_TRUTH_TABLE[fill],
|
||||
|
||||
Reference in new issue
Block a user