Opened 7 years ago

Closed 7 years ago

#15060 closed defect (fixed)

Shape.setClip fails if the surface has been cleared()

Reported by: Patrick Ruzand Owned by: Patrick Ruzand
Priority: undecided Milestone: 1.8
Component: DojoX GFX Version:
Keywords: Cc:
Blocked By: Blocking:

Description

The following sequence leads to a "clipNode is null" error:

  shape = surface.createXXXX(..);
  shape.setClip({...});
  surface.clear();
  surface.add(shape);
  shape.setClip({...});

the following example reproduces the problem:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
	<head>
		<title>Test Clip</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<script type="text/javascript" src="./dojo/dojo.js" data-dojo-config="async:true, isDebug:true"></script>
		<script type="text/javascript">
			require([
				"dojo/ready",
				"dojo/_base/array", 
				"dojo/dom", 
				"dojo/on", 
				"dojox/gfx", 
				"dojox/gfx/matrix",
				"dojox/gfx/Moveable"], 
				function(ready, array, dom, on, gfx, matrix, Moveable) {
				ready(function(){
					this.surface = gfx.createSurface(dom.byId("gfx_holder"), 400, 300);
					this.plotGroup = this.surface.createGroup();
					this.plotGroup.setClip({x: 0, y: 0, width: 10, height: 10});
					var rect = this.plotGroup.createRect().setFill("red");
					this.plotGroup.removeShape();
					this.surface.clear();
					this.surface.add(this.plotGroup);
					this.plotGroup.setClip({x: 0, y: 0, width: 10, height: 10});
				});
			});

		</script>
	</head>
	<body style="font-family:sans-serif;font-size:10pt">
		<h1>Test Clip</h1>
		<div id="gfx_holder" style="width: 600px; height: 550px; border: solid;background-color: #eeeeee"></div>
	</body>
</html>

Change History (3)

comment:1 Changed 7 years ago by Patrick Ruzand

Owner: changed from Eugene Lazutkin to Patrick Ruzand
Status: newassigned

comment:2 Changed 7 years ago by Patrick Ruzand

Milestone: tbd1.8

comment:3 Changed 7 years ago by Patrick Ruzand

Resolution: fixed
Status: assignedclosed

In [28222]:

fix setClip, fixes #15060 !strict

Note: See TracTickets for help on using tickets.