Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#3857 closed defect (fixed) does not work

Reported by: guest Owned by: Eugene Lazutkin
Priority: high Milestone: 0.9
Component: DojoX GFX Version: 0.9
Keywords: Cc: [email protected]
Blocked By: Blocking:


I see the following issues in FF/Opera/Safari when using clear() on a Group: #1: In Firefox/Opera/Safari?, calling clear() does not remove a Rect. An Image is removed #2: Removing the Rect by calling group.remove() removes it #3: In Safari 3 (beta), the Image is added, but not visible till u switch to a different tab and return. Must be some sort of refresh issue.

Works fine in IE.

The following code is a simple test case I put together to test these.



<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>dojox.gfx.Group</title>

<script type="text/javascript"


<script type="text/javascript">


var surface, root, rect, image; function init() {

create surface surface = dojox.gfx.createSurface(dojo.byId("div"), 400, 400); create root group to add all graphics into root = surface.createGroup();


function addRect() {

if (! rect) {

rect = root.createRect({ x:100, y:100, width:100, height:100 }); rect.setFill([255, 0, 0]);



function removeRect() {

root.remove(rect); rect = null;


function addImage() {

if (! image) {

image = root.createImage({ x:200, y:200, width:100,

height:100, src:"" });



function removeImage() {

root.remove(image); image = null;


function clearRoot() {

surface = root.clear(); rect = image = null;




</head> <body>

<div id="div" style="width:400px; height:400px; border:1px solid


<input type="button" value="Add Rect" onclick="addRect()" /> <input type="button" value="Remove Rect" onclick="removeRect()" /> <input type="button" value="Add Image" onclick="addImage()" /> <input type="button" value="Remove Image" onclick="removeImage()" /> <input type="button" value="Clear" onclick="clearRoot()" />



Attachments (1)

dojox_gfx_group.html (2.3 KB) - added by guest 15 years ago.
Code sample

Download all attachments as: .zip

Change History (4)

comment:1 Changed 15 years ago by Eugene Lazutkin

Status: newassigned

Changed 15 years ago by guest

Attachment: dojox_gfx_group.html added

Code sample

comment:2 Changed 15 years ago by Eugene Lazutkin

Resolution: fixed
Status: assignedclosed

(In [9842]) Fixes #3857. Thx, Jayant B. Sai!

comment:3 Changed 15 years ago by Eugene Lazutkin

I could not reproduce Safari 3 Beta bug. It works as expected.

BTW, some .png images don't work properly on IE. Try to use .gif or .jpg if possible.

Note: See TracTickets for help on using tickets.