You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by bi...@apache.org on 2014/09/06 00:23:26 UTC

[3/3] git commit: [flex-asjs] [refs/heads/develop] - Adjust the x and y of the rect to account for the stroke weight After drawing, call resize on the svg element with the correct dimensions

Adjust the x and y of the rect to account for the stroke weight
After drawing, call resize on the svg element with the correct dimensions


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/72c90096
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/72c90096
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/72c90096

Branch: refs/heads/develop
Commit: 72c900969d67308dfa846916aa9b605c73f1ed1b
Parents: f1ae81b
Author: Om <bi...@gmail.com>
Authored: Fri Sep 5 15:17:24 2014 -0700
Committer: Om <bi...@gmail.com>
Committed: Fri Sep 5 15:19:36 2014 -0700

----------------------------------------------------------------------
 frameworks/js/FlexJS/src/org/apache/flex/core/graphics/Rect.js | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/72c90096/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/Rect.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/Rect.js b/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/Rect.js
index 570cb16..f06e318 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/Rect.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/Rect.js
@@ -65,10 +65,11 @@ org.apache.flex.core.graphics.Rect.prototype.drawRect = function(x, y, width, he
 
 	var rect = document.createElementNS('http://www.w3.org/2000/svg', 'rect');
 	rect.setAttribute('style', style);
-	rect.setAttribute('x', String(x));
-	rect.setAttribute('y', String(y));
+	rect.setAttribute('x', String(this.get_stroke().get_weight()));
+	rect.setAttribute('y', String(this.get_stroke().get_weight()));
 	rect.setAttribute('width', String(width));
 	rect.setAttribute('height', String(height));
 	rect.setAttribute('fill-opacity', String(this.get_fill().get_alpha()));
 	this.element.appendChild(rect);
+	this.resize(x,y,width+this.get_stroke().get_weight()*2,height+this.get_stroke().get_weight()*2);
 };