changing default shapes to be all lines, and fixing text centering bug
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
web2d.Line = function(attributes)
|
||||
{
|
||||
var peer = web2d.peer.Toolkit.createLine();
|
||||
var defaultAttributes = {strokeColor:'#495879',strokeWidth:1};
|
||||
var defaultAttributes = {strokeColor:'#495879',strokeWidth:1, strokeOpacity:1};
|
||||
for (var key in attributes)
|
||||
{
|
||||
defaultAttributes[key] = attributes[key];
|
||||
|
@@ -62,8 +62,11 @@ web2d.peer.svg.TextPeer.prototype.getText = function()
|
||||
web2d.peer.svg.TextPeer.prototype.setPosition = function(x, y)
|
||||
{
|
||||
this._position = {x:x, y:y};
|
||||
var size = parseInt(this._font.getSize());
|
||||
this._native.setAttribute('y', y + size);
|
||||
var height = this._font.getSize();
|
||||
if(this._parent && this._native.getBBox)
|
||||
height = this.getHeight();
|
||||
var size = parseInt(height);
|
||||
this._native.setAttribute('y', y+size*3/4);
|
||||
//y+size/2
|
||||
this._native.setAttribute('x', x);
|
||||
};
|
||||
|
Reference in New Issue
Block a user