Daniel Kurka has uploaded a new change for review.

  https://gwt-review.googlesource.com/3613


Change subject: Add wrap method to Canvas
......................................................................

Add wrap method to Canvas

fixes issue 6683

Change-Id: Ieca5c14e41b495da75004fa080409fca1b21b3d5
---
M user/src/com/google/gwt/canvas/client/Canvas.java
1 file changed, 14 insertions(+), 0 deletions(-)



diff --git a/user/src/com/google/gwt/canvas/client/Canvas.java b/user/src/com/google/gwt/canvas/client/Canvas.java
index 99a314d..1018024 100644
--- a/user/src/com/google/gwt/canvas/client/Canvas.java
+++ b/user/src/com/google/gwt/canvas/client/Canvas.java
@@ -22,6 +22,7 @@
 import com.google.gwt.dom.client.Document;
 import com.google.gwt.dom.client.PartialSupport;
 import com.google.gwt.user.client.ui.FocusWidget;
+import com.google.gwt.user.client.ui.RootPanel;

 /**
  * A widget representing a <canvas> element.
@@ -51,6 +52,19 @@
     return new Canvas(element);
   }

+  public Canvas wrap(CanvasElement element) {
+    if (!isSupported()) {
+      return null;
+    }
+    Canvas canvas = new Canvas(element);
+
+    // Mark it attached and remember it for cleanup.
+    canvas.onAttach();
+    RootPanel.detachOnWindowClose(canvas);
+
+    return canvas;
+  }
+
   /**
* Runtime check for whether the canvas element is supported in this browser.
    *

--
To view, visit https://gwt-review.googlesource.com/3613
To unsubscribe, visit https://gwt-review.googlesource.com/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ieca5c14e41b495da75004fa080409fca1b21b3d5
Gerrit-PatchSet: 1
Gerrit-Project: gwt
Gerrit-Branch: master
Gerrit-Owner: Daniel Kurka <[email protected]>

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors
--- You received this message because you are subscribed to the Google Groups "GWT Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to