examples/openvg/star/starwidget.cpp
changeset 19 fcece45ef507
parent 18 2f34d5167611
child 30 5dc02b23752f
--- a/examples/openvg/star/starwidget.cpp	Fri Apr 16 15:50:13 2010 +0300
+++ b/examples/openvg/star/starwidget.cpp	Mon May 03 13:17:34 2010 +0300
@@ -93,8 +93,9 @@
     // and prepare to perform raw OpenVG calls.
     painter.beginNativePainting();
 
-    // Cache the path if we haven't already.
-    if (path == VG_INVALID_HANDLE) {
+    // Cache the path if we haven't already or if the path has
+    // become invalid because the window's context has changed.
+    if (path == VG_INVALID_HANDLE || !vgGetPathCapabilities(path)) {
         path = vgCreatePath(VG_PATH_FORMAT_STANDARD,
                             VG_PATH_DATATYPE_F,
                             1.0f, // scale