Opened 10 years ago

Closed 4 years ago

#10885 closed defect (patchwelcome)

Silverlight Surface.getDimensions seems to break?

Reported by: Erik Demaine Owned by: Eugene Lazutkin
Priority: low Milestone: 1.13
Component: DojoX GFX Version: 1.4.2
Keywords: Cc:
Blocked By: Blocking:

Description

The attached simple test of dojox.gfx gets confusing reports from getDimensions() from the surface it creates. On load, the surface is created as 800x600, and an immediate call to getDimensions() reports 800x600. But if we wait a moment (via setTimeout), then the surface's getDimensions() reports 1033x775, which is roughly same aspect ratio but is wrong. You can see that it is indeed wrong by drawing two rectangles of the two sizes, and the red one (with the original size) is correct while the purple one (with the new size) is too big and shifted.

(You will have to change the first SCRIPT call to dojo.js.)

Attachments (1)

simple.html (1.5 KB) - added by Erik Demaine 10 years ago.
demonstration of getDimensions bug

Download all attachments as: .zip

Change History (5)

Changed 10 years ago by Erik Demaine

Attachment: simple.html added

demonstration of getDimensions bug

comment:1 Changed 10 years ago by Eugene Lazutkin

Milestone: tbdfuture
Priority: normallow
Status: newassigned

comment:2 Changed 9 years ago by beta vulgaris

I've encountered this problem while using dojox.charting in silverlight. My charts wouldn't resize properly at all! I've found the problem to be in getDimensions() in silverlight.js.

This fixed my issues: Instead of:

var p = this.rawNode && this.rawNode.getHost(); var t = p ? {width: p.content.actualWidth, height: p.content.actualHeight} : null; if(t.width <= 0){ t.width = this.width; } if(t.height <= 0){ t.height = this.height; } return t; Object

I use:

t = {width: this.width, height: this.height}; return t; Object

comment:3 Changed 9 years ago by Eugene Lazutkin

Related to #12080.

comment:4 Changed 4 years ago by dylan

Milestone: future1.12
Resolution: patchwelcome
Status: assignedclosed

Silverlight is mostly abandoned as a tech, except as an IE7/8 fallback, so closing as patchwelcome.

Note: See TracTickets for help on using tickets.