Permalink
Browse files

rect now uses w/h attrs instead of dx/dy. draw() now sets top/left/wi…

…dth/height according to attr()
  • Loading branch information...
Dan Newcome
Dan Newcome committed Dec 12, 2011
1 parent cf57aaa commit 17e1c855ee647f7b682b4781e8175fcd8a5c0f83
Showing with 7 additions and 1 deletion.
  1. +7 −1 rect.js
View
@@ -15,7 +15,7 @@ Donatello.Pgram = function( parent, x, y, dx, dy, skew, a ) {
var style = a['stroke-style'];
this.properties = {
- x: x, y: y, dx: dy, skew: skew,
+ x: x, y: y, w: dx, h: dy, skew: skew,
'stroke-width': s,
'stroke-style': style,
'stroke': c,
@@ -38,6 +38,12 @@ Donatello.Pgram.prototype.draw = function() {
if( skew != null ) {
el.style[ Donatello.getTransform() ] += 'skew(' + skew + 'deg)';
}
+
+ el.style.top = this.properties.y + 'px';
+ el.style.left = this.properties.x + 'px';
+
+ el.style.width = this.properties.w + 'px';
+ el.style.height = this.properties.h + 'px';
}
Donatello.prototype.pgram = function( x, y, dx, dy, skew, a ) {

0 comments on commit 17e1c85

Please sign in to comment.