From 9c2cb393c2f208bdeaebf3f86018a4101f71d100 Mon Sep 17 00:00:00 2001 From: Alexander Ljungberg Date: Mon, 15 Oct 2012 02:49:11 +0100 Subject: [PATCH] `CGContextIsPathEmpty` for non-canvas based platforms. Unfortunately there doesn't seem to be a way to get the current path from a canvas context so this function only works in VML mode for now. --- AppKit/CoreGraphics/CGContext.j | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/AppKit/CoreGraphics/CGContext.j b/AppKit/CoreGraphics/CGContext.j index a67d7b200..883ef2241 100644 --- a/AppKit/CoreGraphics/CGContext.j +++ b/AppKit/CoreGraphics/CGContext.j @@ -321,6 +321,16 @@ function CGContextClosePath(aContext) CGPathCloseSubpath(aContext.path); } +/*! + Return YES if the current path in the given context is empty. + @param aContext the CGContext to examine + @return BOOL +*/ +function CGContextIsPathEmpty(aContext) +{ + return (!aContext.path || CGPathIsEmpty(aContext.path)); +} + /*! Moves the current location of aContext to the given x and y coordinates @param aContext the CGContext to move